From 8076e045dd445599c8755d2ca3b9583677607549 Mon Sep 17 00:00:00 2001 From: Devin Dice Date: Sun, 15 Jan 2023 22:54:38 -0500 Subject: [PATCH] Updating script --- rootfs/usr/bin/graphhopper | 124576 +--------------------------------- 1 file changed, 33 insertions(+), 124543 deletions(-) diff --git a/rootfs/usr/bin/graphhopper b/rootfs/usr/bin/graphhopper index 5234fc2..e61813f 100755 --- a/rootfs/usr/bin/graphhopper +++ b/rootfs/usr/bin/graphhopper @@ -1,124535 +1,6 @@ #!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi - -BUILD_MAP#!/bin/bash -SCRIPT="Generate Maps" -WORKING_DIRECTORY=/workspace/Graphhopper_Files - -OK_RESPONSE () { - whiptail --title "$SCRIPT" --msgbox "$MESSAGE" 15 120 -} - -INFO_BOX () { - TERM=ansi whiptail --title "$SCRIPT" --infobox "$MESSAGE" 15 120 -} - -YES_NO_RESPONSE () { - whiptail --title "$SCRIPT" --yesno "$MESSAGE" 15 120 -} - - -TEXT_INPUT () { - OUTPUT=$(whiptail --title "$SCRIPT" --inputbox "$MESSAGE" 8 80 "$PLACEHOLDER" 3>&1 1>&2 2>&3) -} - -BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" - { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then - echo "An error occured during the first OSM convert (Part 1), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then - echo "An error occured in Osmosis (Part 2), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then - echo "An error occured during the second OSM convert (Part 3), Exiting." - echo "$OUTPUT" - exit 1 - fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 -} - -# START OF SCRIPT -if ! OUTPUT=$(ls -1 /workspace/Graphhopper_Files 2>&1); then - echo "Your directory structure is not correct, exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the name for this map."; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - NAME=$( echo $OUTPUT | awk '{print tolower($0)}' | sed 's/ /_/g') -else - echo "The user did not enter a name. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the Region. (usa, europe)"; PLACEHOLDERR=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - REGION=$( echo $OUTPUT | awk '{print tolower($0)}') - if [[ $REGION == "usa" ]]; then - MAP="us-latest.osm.pbf" - elif [[ $REGION == "usa" ]]; then - MAP="europe-latest.osm.pbf" - else - echo "The user did not enter a valid region. Exiting" - exit 1 - fi -else - echo "The user did not enter a region. Exiting" - exit 1 -fi - -OUTPUT=/dev/null -MESSAGE="Enter the coordinates for this map."; PLACEHOLDER=""; TEXT_INPUT -if [[ ! -z $OUTPUT ]]; then - COORDINATES=$OUTPUT -else - echo "The user did not enter the coordinates. Exiting" - exit 1 -fi - -if [[ $(echo $COORDINATES | sed 's/,/\n/g' | wc -l) != 4 ]]; then - echo "The user did not enter valid coordinates. Exiting" - exit 1 -fi - -MESSAGE="Please confirm the following details.\n\nNAME: $NAME\nREGION: $REGION\nCOORDINATES: $COORDINATES"; -if ! YES_NO_RESPONSE; then - echo "User selected not to continue, exiting!" - exit 1 -fi +# Place this in /usr/bin/ -BUILD_MAP#!/bin/bash SCRIPT="Generate Maps" WORKING_DIRECTORY=/workspace/Graphhopper_Files @@ -124551,31 +22,50 @@ TEXT_INPUT () { } BUILD_MAP () { - echo "NAME: $NAME" - echo "COORDINATES: $COORDINATES" { - echo 0 - mkdir ${WORKING_DIRECTORY}/${REGION}/${NAME} - echo 5 - if OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then + # osmconvert extract + echo -e "XXX\n0\5\nCreating Directory... (${NAME}.osm) \nXXX" + mkdir -p ${WORKING_DIRECTORY}/${REGION}/${NAME} + echo "$(date) Starting Map Creation" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + sleep 1 + echo -e "XXX\n20\nExtracting Coordinates... (${NAME}.osm) \nXXX" + if ! OUTPUT=$(osmconvert ${WORKING_DIRECTORY}/${REGION}/${MAP} -b=${COORDINATES} -o=${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm 2>&1); then echo "An error occured during the first OSM convert (Part 1), Exiting." echo "$OUTPUT" + echo "$(date) Coordinates failed to Extract" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + echo "$OUTPUT" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt exit 1 fi - echo 45 - if OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then + echo "$OUTPUT" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + echo "$(date) Coordinates Extracted (${NAME}.osm)" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + + # osmosis + echo -e "XXX\n65\nExporting Roads... (${NAME}roads.osm) \nXXX" + if ! OUTPUT=$(osmosis --read-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.osm --tf accept-ways highway=* --used-node --write-xml ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm 2>&1); then echo "An error occured in Osmosis (Part 2), Exiting." echo "$OUTPUT" + echo "$(date) Exporting roads failed" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + echo "$OUTPUT" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt exit 1 fi - echo 90 - if OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then + echo "$OUTPUT" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + echo "$(date) Roads Extracted (${NAME}roads.osm)" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + + # osmconvert compress + echo -e "XXX\n90\nCompressing... (${NAME}.pbf)\nXXX" + if ! OUTPUT=$(osmconvert --out-pbf ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}roads.osm > ${WORKING_DIRECTORY}/${REGION}/${NAME}/${NAME}.pbf 2>&1); then echo "An error occured during the second OSM convert (Part 3), Exiting." echo "$OUTPUT" + echo "$(date) Compressing failed" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + echo "$OUTPUT" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt exit 1 fi - echo 100 - } | whiptail --gauge "Please wait while the maps generate..." 6 50 0 + echo "$OUTPUT" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + echo "$(date) Compression complete (${NAME}.pbf)" >> ${WORKING_DIRECTORY}/${REGION}/${NAME}/log.txt + + echo -e "XXX\n100\nProcess Completed Successfully! \nXXX" + sleep 1 + } | whiptail --gauge "Please wait while the maps generate..." 6 80 0 } # START OF SCRIPT @@ -124630,4 +120,4 @@ if ! YES_NO_RESPONSE; then exit 1 fi -BUILD_MAP +BUILD_MAP \ No newline at end of file