diff options
author | Jochen Topf <jochen@topf.org> | 2010-11-13 21:31:39 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2010-11-13 21:31:39 +0100 |
commit | 9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d (patch) | |
tree | 0d2ae6de413c39c21d30aaf296a98ee37977ab45 /sources/josm | |
parent | c82bbe69572398d44187ca7b57b1ce572f435d65 (diff) | |
download | taginfo-9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d.tar taginfo-9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d.tar.gz |
Multiple changes
* Improved and cleaned up source import scripts
* Improved some reports and report overview
* New osmium version that uses a better hash function
* Some experimental magic to include Javascipt in an easier way (tested in keys.erb)
Diffstat (limited to 'sources/josm')
-rw-r--r-- | sources/josm/post.sql | 2 | ||||
-rw-r--r-- | sources/josm/pre.sql | 19 | ||||
-rwxr-xr-x | sources/josm/update.sh | 17 |
3 files changed, 13 insertions, 25 deletions
diff --git a/sources/josm/post.sql b/sources/josm/post.sql index 352b026..8dd6972 100644 --- a/sources/josm/post.sql +++ b/sources/josm/post.sql @@ -18,5 +18,5 @@ INSERT INTO stats (key, value) SELECT 'josm_tags_in_style_rules', count(distinct ANALYZE; -UPDATE meta SET update_end=datetime('now'); +UPDATE source SET update_end=datetime('now'); diff --git a/sources/josm/pre.sql b/sources/josm/pre.sql index 42a4213..5c2975d 100644 --- a/sources/josm/pre.sql +++ b/sources/josm/pre.sql @@ -6,24 +6,7 @@ .bail ON -DROP TABLE IF EXISTS meta; - -CREATE TABLE meta ( - source_id TEXT, - source_name TEXT, - update_start TEXT, - update_end TEXT, - data_until TEXT -); - -INSERT INTO meta (source_id, source_name, update_start, data_until) SELECT 'josm', 'JOSM', datetime('now'), datetime('now'); - -DROP TABLE IF EXISTS stats; - -CREATE TABLE stats ( - key TEXT, - value INT64 -); +INSERT INTO source (id, name, update_start, data_until) SELECT 'josm', 'JOSM', datetime('now'), datetime('now'); -- -- josm_styles diff --git a/sources/josm/update.sh b/sources/josm/update.sh index 6eca722..abfb7e9 100755 --- a/sources/josm/update.sh +++ b/sources/josm/update.sh @@ -9,12 +9,14 @@ set -e DIR=$1 +DATECMD='date +%Y-%m-%dT%H:%M:%S' + if [ "x" = "x$DIR" ]; then echo "Usage: update.sh DIR" exit 1 fi -echo -n "Start josm: "; date +echo "`$DATECMD` Start josm..." DATABASE=$DIR/taginfo-josm.db ELEMSTYLES=$DIR/elemstyles.xml @@ -22,17 +24,20 @@ ELEMSTYLES=$DIR/elemstyles.xml rm -f $DATABASE rm -f $ELEMSTYLES -echo "Getting styles..." +echo "`$DATECMD` Getting styles..." wget -O $ELEMSTYLES http://josm.openstreetmap.de/svn/trunk/styles/standard/elemstyles.xml -echo "Running pre.sql..." +echo "`$DATECMD` Running init.sql..." +sqlite3 $DATABASE <../init.sql + +echo "`$DATECMD` Running pre.sql..." sqlite3 $DATABASE <pre.sql -echo "Running import..." +echo "`$DATECMD` Running import..." ./import_josm.rb $DIR -echo "Running post.sql..." +echo "`$DATECMD` Running post.sql..." sqlite3 $DATABASE <post.sql -echo -n "Done josm: "; date +echo "`$DATECMD` Done josm." |