X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/33a65a90c9d0e2ab121e1da9c3efedaf9e6a9789..fb17928db19ed0b1e32e5da9d94d6c415d505a1a:/lib/quad_tile.rb?ds=inline 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