diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-18 17:50:44 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-18 17:50:44 +0100 |
commit | b17a29ca705f07c294f5dc34396f59420f008d1b (patch) | |
tree | bd14ef2b601f511daa164dee729e1617158595df /sources | |
parent | bc6927f3d283f72e61d444096d419b32728165c4 (diff) | |
download | taginfo-b17a29ca705f07c294f5dc34396f59420f008d1b.tar taginfo-b17a29ca705f07c294f5dc34396f59420f008d1b.tar.gz |
Get images for relations, too
Diffstat (limited to 'sources')
-rwxr-xr-x | sources/wiki/get_image_info.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/wiki/get_image_info.rb b/sources/wiki/get_image_info.rb index cabd169..caaf952 100755 --- a/sources/wiki/get_image_info.rb +++ b/sources/wiki/get_image_info.rb @@ -53,7 +53,7 @@ api = MediaWikiAPI::API.new('wiki.openstreetmap.org') db = SQLite3::Database.new(dir + '/taginfo-wiki.db') db.results_as_hash = true -image_titles = db.execute("SELECT DISTINCT(image) AS title FROM wikipages WHERE image IS NOT NULL AND image != ''"). +image_titles = db.execute("SELECT DISTINCT(image) AS title FROM wikipages WHERE image IS NOT NULL AND image != '' UNION SELECT DISTINCT(image) AS title FROM relation_pages WHERE image IS NOT NULL AND image != ''"). map{ |row| row['title'] }. select{ |title| title.match(%r{^(file|image):}i) } |