source: subversion/applications/rendering/gosmore/appendOSBtoOSM.sh @ 34918

Last change on this file since 34918 was 15979, checked in by daviddean, 10 years ago

Changed appendOSBtoOSM.sh script to be a bit more flexible. Now takes a url parameter pointing to a OSB gpx download url

  • Property svn:executable set to *
File size: 651 bytes
Line 
1#!/bin/bash -u
2
3# this is an example script for adding openstreetbugs to a osm pak file
4# example usage: bzcat planet-extract.osm.bz2 \
5#   | ./appendOSBtoOSM.sh 'http://openstreetbugs.schokokeks.org/api/0.1/getGPX?b=-27.60787&t=-27.28064&l=152.69114&r=153.30363&open=yes' \
6#   | ./gosmore rebuild
7
8url=$1
9
10tempfolder=$(mktemp -d)
11
12wget --quiet $url \
13    -O $tempfolder/OSB.gpx
14
15# convert to osm format using gpsbabel
16gpsbabel -i GPX -f $tempfolder/OSB.gpx \
17    -o osm,tagnd="openstreetbug:yes" -F $tempfolder/OSB.osm
18
19# concatenate with existing osm file
20egrep -v '^</osm' /dev/stdin
21egrep -v '^<(osm|\?xml)' $tempfolder/OSB.osm
22
23rm -r $tempfolder
Note: See TracBrowser for help on using the repository browser.