Skip to content

Commit b3168e8

Browse files
committed
Use osmium-tool
1 parent da0fa3b commit b3168e8

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

mapcreator/convert_docker.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ docker compose up --no-start additional-data
2828
docker compose up --no-start mapstyles
2929

3030
time docker compose run mtk2garmin-converter java -jar /opt/mtk2garmin/target/mtk2garmin-0.0.2.jar /opt/mtk2garmin/mtk2garmin.conf
31-
time docker compose run merger ./merge_files.sh
31+
time docker compose run merger ./process_osm.sh
3232

3333
time docker compose run mkgmap ./run_mkgmap.sh
3434

@@ -38,7 +38,7 @@ time docker compose run mapsforge /app/bin/osmosis \
3838
simplification-max-zoom=12 simplification-factor=16 threads=4 \
3939
zoom-interval-conf=5,4,7,8,8,11,12,12,13,14,14,21 \
4040
label-position=true polylabel=true \
41-
tag-conf-file=/mapstyles/mapsforge_peruskartta/mml_tag-mapping_tidy.xml type=hd comment="(c) NLS, Metsahallitus, Liikennevirasto, OpenStreetMap contributors 2019"
41+
tag-conf-file=/mapstyles/mapsforge_peruskartta/mml_tag-mapping_tidy.xml type=hd comment="(c) NLS, Metsahallitus, Liikennevirasto, OpenStreetMap contributors 2025"
4242

4343

4444
time docker compose run osxconverter

mapcreator/merge/Dockerfile

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
FROM ubuntu
1+
FROM teemupel/mtk2garmin-ubuntugis-base
22

33
WORKDIR /opt/mapmerge
4-
RUN apt-get update && apt-get upgrade -y && apt-get install -y build-essential curl zlib1g-dev python3 parallel
54

6-
RUN curl --fail --retry 5 --retry-delay 30 http://m.m.i24.cc/osmconvert.c | cc -x c - -lz -O3 -o osmconvert && \
7-
curl --fail --retry 5 --retry-delay 30 http://m.m.i24.cc/osmfilter.c |cc -x c - -O3 -o osmfilter && \
8-
chmod +x osmconvert && \
9-
chmod +x osmfilter
10-
11-
ADD . .
12-
RUN chmod +x merge_files.sh && chmod +x process_osm.sh
5+
ADD process_osm.sh .
6+
RUN chmod +x process_osm.sh
137

mapcreator/merge/process_osm.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22
set -euxo pipefail
33

4-
time ./osmconvert /additional-data/finland-latest.osm.pbf -o=/convertedpbf/finland-latest.o5m
5-
time ./osmfilter /convertedpbf/finland-latest.o5m --keep="highway=track =path =footway =cycleway =trail amenity=shelter =toilets tourism=fireplace =lean_to =wilderness man_made=tower and tower:type=observation" --drop-author --drop-version --verbose --out-o5m > /convertedpbf/finland-filtered.o5m
6-
time ./osmconvert /convertedpbf/finland-filtered.o5m --out-o5m | ./osmconvert - /convertedpbf/all_direct.osm.pbf -o=/convertedpbf/all_osm.osm.pbf
7-
time ./osmconvert /additional-data/finland-latest.osm.pbf --out-statistics
8-
time ./osmconvert /convertedpbf/finland-filtered.o5m --out-statistics
9-
time ./osmconvert /convertedpbf/all.osm.pbf --out-statistics
10-
time ./osmconvert /convertedpbf/all_osm.osm.pbf --out-statistics
4+
time osmium sort -s multipass /convertedpbf/all_direct.osm.pbf -o /convertedpbf/all_direct_sorted.osm.pbf
5+
time osmium tags-filter -o /convertedpbf/finland-filtered.osm.pbf /additional-data/finland-latest.osm.pbf w/highway=track,path,footway,cycleway,trail n/amenity=shelter,toilets n/tourism=fireplace,lean_to,wilderness n/man_made=tower n/tower:type=observation
6+
time osmium merge /convertedpbf/finland-filtered.osm.pbf /convertedpbf/all_direct_sorted.osm.pbf -o /convertedpbf/all_osm.osm.pbf --overwrite
7+
osmium fileinfo /additional-data/finland-latest.osm.pbf
8+
osmium fileinfo /convertedpbf/finland-filtered.osm.pbf
9+
osmium fileinfo /convertedpbf/all_direct.osm.pbf
10+
osmium fileinfo /convertedpbf/all_osm.osm.pbf

mapcreator/ubuntugis-base/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ RUN apt update && apt install -y curl
44

55
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash && \
66
. /root/.bashrc && nvm install 22 && apt update && apt upgrade -y && \
7-
apt install -y git p7zip-full nodejs default-jdk maven&& \
7+
apt install -y git p7zip-full nodejs default-jdk maven osmium-tool&& \
88
npm install -g svgo &&\
99
apt clean

0 commit comments

Comments
 (0)