Add a facility to ignore sections of the file and ignore [IMG ID] ...
[ump2osm.git] / osm-merge
blobb3e372092c4fd43e3c8d7b0aee7be4d6c470a185
1 #! /bin/bash
2 # Copyright (C) 2009 Andrzej Zaborowski
3 # Merge two .osm files without applying fancy logic (JOSM merge layers
4 # operation tries to be too smart and corrupts data - see bug #2245)
5 if [ $# != 2 ]; then
6 echo Usage: $0 a.osm b.osm \> a+b.osm >&2
7 exit
8 fi
10 echo "<?xml version='1.0' encoding='UTF-8'?>"
11 echo "<osm version='0.6' generator='$0'>"
12 cat "$1" | grep -v "<osm" | grep -v "<\\?xml" | grep -v "</osm"
13 cat "$2" | grep -v "<osm" | grep -v "<\\?xml" | grep -v "</osm" | \
14 sed "s/id='-/id='-1000000/" | \
15 sed "s/ref='-/ref='-1000000/"
16 echo "</osm>"