[OSM-dev] get_multis_from_segments.rb query

nick at hogweed.org nick at hogweed.org
Fri Jun 9 00:24:45 BST 2006


Am putting together a script which dumps the database out direct as a .osm 
file, shortcutting the DOM.

I have one question about the get_multis_from_segments.rb script, called from 
map.rb. Why, once the list of ways in the bounding box is obtained, is the 
following statement:

sql = "select c.id, timestamp, group_concat(segment_id) as segs, tags, visible 
from (select b.version, b.id, b.visible, b.timestamp, group_concat(k , 
concat('===', v) SEPARATOR '|||') as tags from (select * from (select * from 
#{type}s where id in (#{ids.join(',')}) order by version desc, id) as a group 
by id) as b join #{type}_tags on #{type}_tags.id = b.id and 
#{type}_tags.version = b.version group by id) as c join #{type}_segments on 
#{type}_segments.id = c.id and #{type}_segments.version = c.version group by 
c.id"

called rather than simply calling the get_multi() method on each way ID? 
        
Nick




More information about the dev mailing list