diff options
author | Jochen Topf <jochen@topf.org> | 2011-10-12 17:07:08 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2011-10-12 17:07:08 +0200 |
commit | e6ba7db9ef8f4f02415b6bcc90f0e8acc7c6ba04 (patch) | |
tree | 091ed0016b45a18288920fc3fe05c734f149ab7e /examples | |
parent | 37218f57f1b53a5f0b1a3d4e4444e8d80b5d667c (diff) | |
download | taginfo-e6ba7db9ef8f4f02415b6bcc90f0e8acc7c6ba04.tar taginfo-e6ba7db9ef8f4f02415b6bcc90f0e8acc7c6ba04.tar.gz |
Generate distribution maps for keys on way, too
Until now distribution maps were only generated for keys on nodes. No there are
maps for keys on ways, too. (Not for relations, though). This commit also adds
command line options for tagstats to define the area you want the map for. Its
no longer necessary to recompile tagstats if you want to change this.
This commit does not change the UI/API yet, so you still only get the node map.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/get_distribution_image.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/get_distribution_image.rb b/examples/get_distribution_image.rb index 96500a4..b840a1a 100755 --- a/examples/get_distribution_image.rb +++ b/examples/get_distribution_image.rb @@ -1,17 +1,18 @@ #!/usr/bin/ruby # -# get_distribution_image DB KEY +# get_distribution_image DB KEY nodes|ways # require 'rubygems' require 'sqlite3' filename = ARGV[0] -key = ARGV[1] +key = ARGV[1] +type = ARGV[2] db = SQLite3::Database.new(filename) -db.execute("SELECT png FROM key_distributions WHERE key=?", key) do |row| - puts row[0] +db.execute("SELECT #{type} FROM key_distributions WHERE key=?", key) do |row| + $stdout.write row[0] end |