[OSM-dev] Think I've found the renderer bug
Nick Whitelegg
nick at hogweed.org
Sun Sep 3 11:51:53 BST 2006
Testing on the dev server, I think I've found the bug that's causing the
non-rendering of ways properly.
It's down to a change in get_multi in dao.rb. In the latest version of dao.rb:
res.each_hash do |row|
segs << [row['segment_id'].to_i] <-- HERE
end
The code above has been changed so that each member of "segs" is an array of a
single member. Previously, each member of "segs" was simply the ID number.
If revision 1303 is rolled back i.e.
way.segs.each do |segid|
@tagged_segments[segid.id.to_i].style =
@rules.get_style(way.tags) unless way.tags.nil? or
@tagged_segments[segid.id.to_i].nil?
end
is changed to
way.segs.each do |segid|
@tagged_segments[segid.to_i].style = @rules.get_style(way.tags)
unless way.tags.nil? or @tagged_segments[segid.to_i].nil?
end
and the above code in dao.rb is changed to
res.each_hash do |row|
segs << row['segment_id'].to_i
end
it works.
However I suspect that the dao.rb change has been made for a reason, so I'm
leaving alone, and have instead adjusted the code in renderer.rb so that it
takes into account the fact that each member of the "segs" array is itself an
array of one int. Doing this makes it work on the dev server.
I've committed to svn (revision 1313)
Nick
More information about the dev
mailing list