source: subversion/applications/rendering/gosmore/dailyUpdate.sh @ 22745

Last change on this file since 22745 was 22410, checked in by nic, 9 years ago

New way of doing junction penalties. Still not perfect.
Rebuild: Add and index route refs
Change copyright to Simplified BSD
bboxSplit: Behave better when subprocess is gosmore
First check in of daily planet update script.

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2# Copyright 2010 Nic Roets as detailed in the README file.
3# The Osm.org Routing demo daily update script
4# The script runs as a cron job.
5
6# make CFLAGS='-O2 -DRES_DIR=\"/usr/share/gosmore/\" -DHEADLESS -DONLY_ROUTING -DLD_CTRL'
7OSMOSIS=/home/nroets/osmosis-0.35.1/bin/osmosis
8FIRST_OSC=$(readlink /data/planet/planet-latest.osm.bz2 |
9                         sed 's/[^0-9]\|2$//g')
10# A crude way of getting the date of the planet e.g. 100716
11PLANET=/data/planet/planet-$FIRST_OSC.osm.bz2
12OSC_LIST="ls -r /data/planet/daily/*.gz "
13# List of change files from youngest to oldest
14cd /home/nroets/gosmore
15# Get into working directory
16
17if [ g.o -nt $($OSC_LIST | head -n 1) ]
18then exit 0
19fi
20
21# I tried a number of different things (in comments) before I had success.
22# PARAM=$($OSC_LIST |grep -A 30 20${FIRST_OSC}- |
23#     ( read first
24#       echo --rxc $first
25#       awk '{ print "--rxc ", $1, " --mc conflictResolutionMethod=version" }'))
26# CMD="$OSMOSIS $PARAM --rx /dev/stdin --ac --wx -"
27
28#----
29# nice -n 20 $OSMOSIS $PARAM --wxc week.osc
30# exit 0
31# CMD="$OSMOSIS --rxc week.osc --rx /dev/stdin --ac --wx -"
32
33#----
34# PARAM=$($OSC_LIST |grep -A 30 20${FIRST_OSC}- |
35#    ( read first
36#       echo --rxc $first --rx /dev/stdin --ac
37#       awk '{ print "--rxc ", $1, " --ac" }'))
38# CMD="$OSMOSIS $PARAM --wx -"
39
40#----
41PARAM=$($OSC_LIST |grep -B 30 20${FIRST_OSC}- | awk '{ print "--rxc ", $1 }' )
42AC=$($OSC_LIST    |grep -B 30 20${FIRST_OSC}- | awk '{ print "--ac " }')
43
44CMD="$OSMOSIS $PARAM --rx /dev/stdin $AC --wx -"
45
46echo $CMD
47# exit
48
49if nice -n 10 bzcat $PLANET | nice -n 20 $CMD |
50   (cd relations; nice -n 10 ../gosmore sortRelations) |
51   nice -n 20 ./bboxSplit -89 -179 89 -30 "./gosmore rebuild" g.o \
52                         -89 -30 89 179 "cd e; ../gosmore rebuild" europe/g.o
53then mv america/gosmore.pak am.pak
54     mv europe/gosmore.pak eu.pak
55     mv gosmore.pak america/
56     mv e/gosmore.pak europe/
57     mv relations/relations.tbl .
58fi
Note: See TracBrowser for help on using the repository browser.