Makefile: pushall: Add "; true" after every push.
[gpstools.git] / import / gps-postgres / trunk / gps / bin / poisync
blob2e1b242b3c5aae8ae9a7e831e0bc3281bf7c443d
1 #!/bin/bash
2 #=======================================================================
3 # $Id$
4 # For synkronisering av POI og waypoints fra uniten.
5 #=======================================================================
7 gpst -o pgwtab ../unit/wpdata.gpx ../poi/trans/*.gpx | psql gps -a -c "TRUNCATE tmpwayp; COPY tmpwayp FROM STDIN;"
8 psql gps -a -c "UPDATE tmpwayp SET koor = point(round(koor[0]::numeric, 5), round(koor[1]::numeric, 5));"
9 psql gps -a -c "COPY (SELECT koor, name FROM tmpwayp WHERE type IS NULL ORDER BY koor[0] desc, koor[1]) TO '/tmp/un';"
10 psql gps -a -c "COPY (SELECT koor, name FROM tmpwayp WHERE type IS NOT NULL ORDER BY koor[0] desc, koor[1]) TO '/tmp/p';"
12 if [ "$1" = "-d" ]; then
13 diff -u /tmp/un /tmp/p
14 else
15 vimdiff /tmp/un /tmp/p