|
45 | 45 |
|
46 | 46 | log "INFO" "Downloading planet file: ${file_name}" |
47 | 47 |
|
48 | | - wget --progress=dot -e dotbytes=30M -O "${planet_file}" "$OVERPASS_PLANET_URL" |
| 48 | + wget -nv --show-progress --progress=dot -e dotbytes=30M -O "${planet_file}" "$OVERPASS_PLANET_URL" |
49 | 49 |
|
50 | 50 | if [ ! -f "${planet_file}" ]; then |
51 | 51 | log "ERROR" "Failed to download ${file_name}" |
|
65 | 65 | fi |
66 | 66 |
|
67 | 67 | if [[ "$planet_file" == *.osm.pbf ]]; then |
68 | | - log "INFO" "Converting PBF to OSM format using osmium with progress..." |
| 68 | + log "INFO" "Converting PBF to BZ2 format using osmium with progress..." |
69 | 69 | local osm_file="${WORK_DIR}/planet.osm.bz2" |
70 | 70 |
|
71 | 71 | # Check if osmium is available |
|
74 | 74 | exit 1 |
75 | 75 | fi |
76 | 76 |
|
77 | | - # Use pv to show progress |
78 | | - # Run osmium and capture its stderr |
79 | | - set +e |
80 | | -
|
81 | | - stdbuf -oL osmium cat "${planet_file}" -o "${osm_file}" --verbose \ |
82 | | - 2> "${WORK_DIR}/osmium_error.log" | \ |
83 | | - pv -i 60 --format "%t %p%%\n" > /dev/null |
84 | | -
|
85 | | - # Capture the exit status of osmium using PIPESTATUS |
86 | | - exit_status=${PIPESTATUS[0]} |
87 | | -
|
88 | | - set -e |
89 | | -
|
90 | | - # If osmium failed, display the error log |
91 | | - if [ $exit_status -ne 0 ]; then |
92 | | - log "ERROR" "osmium failed with exit status $exit_status" |
93 | | - log "ERROR" "Error output from osmium:" |
94 | | - cat "${WORK_DIR}/osmium_error.log" >&2 |
95 | | - sleep 5 |
96 | | - exit $exit_status |
97 | | - fi |
| 77 | + osmium cat "${planet_file}" -o "${osm_file}" --verbose |
98 | 78 |
|
99 | 79 | if [ ! -f "${osm_file}" ]; then |
100 | 80 | log "ERROR" "OSM file not created: ${osm_file}" |
|
0 commit comments