Skip to content

Commit

Permalink
Fix calculation for relation roles graph
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Jan 19, 2013
1 parent b869f14 commit 9bd2438
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/lib/ui/relation.rb
Expand Up @@ -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 }
Expand Down

0 comments on commit 9bd2438

Please sign in to comment.