Use squiggly heredocs
This commit is contained in:
parent
48463e60cb
commit
7531060a12
1 changed files with 18 additions and 18 deletions
|
@ -906,7 +906,7 @@ module Api
|
||||||
# Alternative SQL queries for getway/whichways
|
# Alternative SQL queries for getway/whichways
|
||||||
|
|
||||||
def sql_find_ways_in_area(bbox)
|
def sql_find_ways_in_area(bbox)
|
||||||
sql = <<-SQL
|
sql = <<~SQL
|
||||||
SELECT DISTINCT current_ways.id AS wayid,current_ways.version AS version
|
SELECT DISTINCT current_ways.id AS wayid,current_ways.version AS version
|
||||||
FROM current_way_nodes
|
FROM current_way_nodes
|
||||||
INNER JOIN current_nodes ON current_nodes.id=current_way_nodes.node_id
|
INNER JOIN current_nodes ON current_nodes.id=current_way_nodes.node_id
|
||||||
|
@ -920,7 +920,7 @@ module Api
|
||||||
|
|
||||||
def sql_find_pois_in_area(bbox)
|
def sql_find_pois_in_area(bbox)
|
||||||
pois = []
|
pois = []
|
||||||
sql = <<-SQL
|
sql = <<~SQL
|
||||||
SELECT current_nodes.id,current_nodes.latitude*0.0000001 AS lat,current_nodes.longitude*0.0000001 AS lon,current_nodes.version
|
SELECT current_nodes.id,current_nodes.latitude*0.0000001 AS lat,current_nodes.longitude*0.0000001 AS lon,current_nodes.version
|
||||||
FROM current_nodes
|
FROM current_nodes
|
||||||
LEFT OUTER JOIN current_way_nodes cwn ON cwn.node_id=current_nodes.id
|
LEFT OUTER JOIN current_way_nodes cwn ON cwn.node_id=current_nodes.id
|
||||||
|
@ -941,7 +941,7 @@ module Api
|
||||||
def sql_find_relations_in_area_and_ways(bbox, way_ids)
|
def sql_find_relations_in_area_and_ways(bbox, way_ids)
|
||||||
# ** It would be more Potlatchy to get relations for nodes within ways
|
# ** It would be more Potlatchy to get relations for nodes within ways
|
||||||
# during 'getway', not here
|
# during 'getway', not here
|
||||||
sql = <<-SQL
|
sql = <<~SQL
|
||||||
SELECT DISTINCT cr.id AS relid,cr.version AS version
|
SELECT DISTINCT cr.id AS relid,cr.version AS version
|
||||||
FROM current_relations cr
|
FROM current_relations cr
|
||||||
INNER JOIN current_relation_members crm ON crm.id=cr.id
|
INNER JOIN current_relation_members crm ON crm.id=cr.id
|
||||||
|
@ -949,7 +949,7 @@ module Api
|
||||||
WHERE #{OSM.sql_for_area(bbox, 'cn.')}
|
WHERE #{OSM.sql_for_area(bbox, 'cn.')}
|
||||||
SQL
|
SQL
|
||||||
unless way_ids.empty?
|
unless way_ids.empty?
|
||||||
sql += <<-SQL
|
sql += <<~SQL
|
||||||
UNION
|
UNION
|
||||||
SELECT DISTINCT cr.id AS relid,cr.version AS version
|
SELECT DISTINCT cr.id AS relid,cr.version AS version
|
||||||
FROM current_relations cr
|
FROM current_relations cr
|
||||||
|
@ -963,7 +963,7 @@ module Api
|
||||||
|
|
||||||
def sql_get_nodes_in_way(wayid)
|
def sql_get_nodes_in_way(wayid)
|
||||||
points = []
|
points = []
|
||||||
sql = <<-SQL
|
sql = <<~SQL
|
||||||
SELECT latitude*0.0000001 AS lat,longitude*0.0000001 AS lon,current_nodes.id,current_nodes.version
|
SELECT latitude*0.0000001 AS lat,longitude*0.0000001 AS lon,current_nodes.id,current_nodes.version
|
||||||
FROM current_way_nodes,current_nodes
|
FROM current_way_nodes,current_nodes
|
||||||
WHERE current_way_nodes.id=#{wayid.to_i}
|
WHERE current_way_nodes.id=#{wayid.to_i}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue