How to join/merge two OSM files of the same region?

Hallo, can someone explain to me how I can join to osm files of the same region (exactly the same because caut with osmosis bounding box)?
I want to include contour lines into a normal country.osm file and afterwards use mkgmap to produce .img for Garmin. Mkgmap cannot join osm files, it can produce .img files that show at the same time, but consist of data.img contour.img tiles. Then one cannot achieve to have the contourlines above polygons but below polylines. Therefore I’ld like to join the osm files themselves.

BTW, here’s my my current workflow for Austria for producing a hiking/biking map. - just in case anyone else would like to compose a map for Austria for his Garmin unit (I use different contour files for the main alps from viewfinderpanorama - they compile smaller than non void filled srtm files. If you want to use SRTM1’ (30m resolution instead of 90m) then the tiles have to be cut to about a tenth of the current size):

srtm2osm.exe -bounds1 47.417 16.583 48.800 17.1670 -step 5 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA0.osm
srtm2osm.exe -bounds1 46.850 16.083 48.797 16.583 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA1.osm
srtm2osm.exe -bounds1 46.360 15.000 47.100 16.083 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA2.osm
srtm2osm.exe -bounds1 47.100 15.000 47.800 16.083 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA3.osm
srtm2osm.exe -bounds1 47.800 15.000 48.600 16.083 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA4.osm
srtm2osm.exe -bounds1 46.367 14.500 48.999 15.000 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA5.osm
srtm2osm.exe -bounds1 46.367 14.000 48.700 14.500 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA6.osm
srtm2osm.exe -bounds1 46.367 14.000 48.700 14.500 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\LA7.osm
srtm2osm.exe -bounds1 48.000 12.667 48.833 14.000 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\OB1.osm
srtm2osm.exe -bounds1 46.467 13.666 48.000 14.000 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\ST1.osm
srtm2osm.exe -bounds1 46.500 13.333 48.000 13.666 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\ST2.osm
srtm2osm.exe -bounds1 46.500 13.000 48.000 13.333 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\ST3.osm
srtm2osm.exe -bounds1 46.633 12.666 48.000 13.000 -step 10 -cat 200 50 50 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\SA1.osm
srtm2osm.exe -bounds1 46.683 12.333 47.700 12.666 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\SA2.osm
srtm2osm.exe -bounds1 46.733 12.000 47.750 12.333 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\SA3.osm
srtm2osm.exe -bounds1 47.000 11.500 47.617 12.000 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\SA4.osm
srtm2osm.exe -bounds1 46.767 11.000 47.533 11.500 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\SA5.osm
srtm2osm.exe -bounds1 46.767 10.500 47.567 11.000 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\T1.osm
srtm2osm.exe -bounds1 46.833 10.000 47.600 10.500 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\T2.osm
srtm2osm.exe -bounds1 46.867 9.5330 47.600 10.000 -step 10 -cat 200 50 10 -large -o d:\garmin\map_composer_041\srtm2osm-1.4.25.1\new\T3.osm

The code below is for the moment not in use, theese are the osm tiles I’ld like to join with the above.

java -Xmx1300M -jar osmosis.jar --read-xml austria.osm --tee 20 --bounding-box bottom=47.417 left=16.583 top=48.800 right=17.167 --write-xml LA00.osm --bounding-box bottom=46.850 left=16.083 top=48.797 right=16.583 --write-xml LA10.osm --bounding-box bottom=46.360 left=15.000 top=47.100 right=16.083 --write-xml LA20.osm --bounding-box bottom=47.100 left=15.000 top=47.800 right=16.083 --write-xml LA30.osm --bounding-box bottom=47.800 left=15.000 top=48.600 right=16.083 --write-xml LA40.osm --bounding-box bottom=46.367 left=14.500 top=48.999 right=15.000 --write-xml LA50.osm --bounding-box bottom=46.367 left=14.000 top=48.700 right=14.500 --write-xml LA60.osm --bounding-box bottom=46.367 left=14.000 top=48.700 right=14.500 --write-xml LA70.osm --bounding-box bottom=48.000 left=12.667 top=48.833 right=14.000 --write-xml OB10.osm --bounding-box bottom=46.467 left=13.666 top=48.000 right=14.000 --write-xml ST10.osm --bounding-box bottom=46.500 left=13.333 top=48.000 right=13.666 --write-xml ST20.osm --bounding-box bottom=46.500 left=13.000 top=48.000 right=13.333 --write-xml ST30.osm --bounding-box bottom=46.633 left=12.666 top=48.000 right=13.000 --write-xml SA10.osm --bounding-box bottom=46.683 left=12.333 top=47.700 right=12.666 --write-xml SA20.osm --bounding-box bottom=46.733 left=12.000 top=47.750 right=12.333 --write-xml SA30.osm --bounding-box bottom=47.000 left=11.500 top=47.617 right=12.000 --write-xml SA40.osm --bounding-box bottom=46.767 left=11.000 top=47.533 right=11.500 --write-xml SA50.osm --bounding-box bottom=46.767 left=10.500 top=47.567 right=11.000 --write-xml T10.osm --bounding-box bottom=46.833 left=10.000 top=47.600 right=10.500 --write-xml T20.osm --bounding-box bottom=46.867 left=9.5330 top=47.600 right=10.000 --write-xml T30.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240009 --description=LA0 LA0.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240001 --description=LA1 LA1.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240002 --description=LA2 LA2.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240003 --description=LA3 LA3.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240004 --description=LA4 LA4.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240005 --description=LA5 LA5.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240006 --description=LA6 LA6.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240007 --description=LA7 LA7.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240008 --description=OB1 OB1.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240020 --description=ST1 ST1.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240021 --description=ST2 ST2.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240022 --description=ST3 ST3.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240031 --description=SA1 SA1.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240032 --description=SA2 SA2.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240033 --description=SA3 SA3.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240034 --description=SA4 SA4.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240035 --description=SA5 SA5.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240040 --description=T1 T1.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240041 --description=T2 T2.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18 --mapname=62240042 --description=T3 T3.osm
java -Xmx1300M -jar D:\Garmin\mkgmap_680\mkgmap.jar --map-features=D:\Garmin\mkgmap_680\resources\cycling_map_features_typfile.csv --levels=0:24,1:22,2:20,3:18,4:16,5:14,6:12,7:10 --mapname=62240050 --description=T3 austria.osm

Remove headers “” tags and all, then paste all the files together. You can do this easily with unix tools, I don’t know how todo this in Windows, so install Cygwin.

place all osm files in one dir and create a file with and run it with “bash filename”

#!/bin/bash
joinedfile=lotsofmaps.osm
echo '<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.5" generator="OpenStreetMap server">' >>$joinedfile
for data in *.osm; do 
   sed '/ *<?xml/d;/ *<osm/d;/ *<bounds/d;/ *<.osm>/d;' $data >>$joinedfile;
done;
echo '</osm>' >>$joinedfile;

Allright thank you a lot. I will try that. (I got dualboot with ubuntu anyhow).

I’m sure there are tools that does this, but it’s so simple to do on your own… So… Cygwin is pretty easy to install if you don’t want to dualboot, but I shouldn’t hinder you to come over to the d… uh… brown side…