summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-19 15:46:57 +0100
committerJochen Topf <jochen@topf.org>2013-01-19 15:46:57 +0100
commit9bd2438576e9fad05d56d2a79b1e227bad4612ec (patch)
tree66574dbd9bca49ca16f7b470412ff8e35c4de86e /web/lib
parentb869f1464b96427dfad91524a693eeb5dc6f4534 (diff)
downloadtaginfo-9bd2438576e9fad05d56d2a79b1e227bad4612ec.tar
taginfo-9bd2438576e9fad05d56d2a79b1e227bad4612ec.tar.gz
Fix calculation for relation roles graph
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/ui/relation.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/lib/ui/relation.rb b/web/lib/ui/relation.rb
index d2df9cc..e2cd5fd 100644
--- a/web/lib/ui/relation.rb
+++ b/web/lib/ui/relation.rb
@@ -36,8 +36,8 @@ class Taginfo < Sinatra::Base
sum = { 'nodes' => 0, 'ways' => 0, 'relations' => 0 }
@db.select("SELECT * FROM db.relation_roles WHERE rtype=? ORDER BY count_all DESC", @rtype).execute() do |row|
%w( nodes ways relations ).each do |type|
- count = row["count_#{ type }"]
- if row['count_all'] < sum_count_all * 0.01
+ count = row["count_#{ type }"].to_i
+ if row['count_all'].to_i < sum_count_all * 0.01
sum[type] += count
else
@roles << { :role => row['role'], :type => type, :value => count }