X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/33a65a90c9d0e2ab121e1da9c3efedaf9e6a9789..32a06b9e5b12b359f6cd6ac5f8d495f2d9fc9b73:/lib/quad_tile.rb?ds=sidebyside diff --git a/lib/quad_tile.rb b/lib/quad_tile.rb index cb1b5a06e..6e4fb6d22 100644 --- a/lib/quad_tile.rb +++ b/lib/quad_tile.rb @@ -41,7 +41,7 @@ module QuadTile end end - def self.sql_for_area(minlat, minlon, maxlat, maxlon) + def self.sql_for_area(minlat, minlon, maxlat, maxlon, prefix) sql = Array.new single = Array.new @@ -49,11 +49,11 @@ module QuadTile if first == last single.push(first) else - sql.push("tile BETWEEN #{first} AND #{last}") + sql.push("#{prefix}tile BETWEEN #{first} AND #{last}") end end - sql.push("tile IN (#{single.join(',')})") if single.size > 0 + sql.push("#{prefix}tile IN (#{single.join(',')})") if single.size > 0 return "( " + sql.join(" OR ") + " )" end