more madness
This commit is contained in:
parent
740511066f
commit
1f857565a6
2 changed files with 28 additions and 26 deletions
|
@ -123,7 +123,7 @@ class AmfController < ApplicationController
|
||||||
points = nodes_not_used_in_area.collect { |n| [n.id, n.lon_potlatch(baselong,masterscale), n.lat_potlatch(basey,masterscale), n.tags_as_hash] }
|
points = nodes_not_used_in_area.collect { |n| [n.id, n.lon_potlatch(baselong,masterscale), n.lat_potlatch(basey,masterscale), n.tags_as_hash] }
|
||||||
|
|
||||||
# find the relations used by those nodes and ways
|
# find the relations used by those nodes and ways
|
||||||
relation_ids = (Relation.find_for_nodes_and_ways(nodes_in_area.collect {|n| n.id}, way_ids)||[]).collect {|n| n.id}.uniq
|
relation_ids = (Relation.find_for_nodes_and_ways(nodes_in_area.collect {|n| n.id}, way_ids)).collect {|n| n.id}.uniq
|
||||||
|
|
||||||
[way_ids,points,relation_ids]
|
[way_ids,points,relation_ids]
|
||||||
end
|
end
|
||||||
|
|
|
@ -102,10 +102,12 @@ class Relation < ActiveRecord::Base
|
||||||
return el1
|
return el1
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.find_for_nodes_and_ways(node_ids, way_ids)
|
|
||||||
# collect relationships. currently done in one big block at the end;
|
# collect relationships. currently done in one big block at the end;
|
||||||
# may need to move this upwards if people want automatic completion of
|
# may need to move this upwards if people want automatic completion of
|
||||||
# relationships, i.e. deliver referenced objects like we do with ways...
|
# relationships, i.e. deliver referenced objects like we do with ways...
|
||||||
|
# FIXME: rip out the fucking SQL
|
||||||
|
def self.find_for_nodes_and_ways(node_ids, way_ids)
|
||||||
return [] if node_ids.empty? and node_ids.empty?
|
return [] if node_ids.empty? and node_ids.empty?
|
||||||
relations = Array.new
|
relations = Array.new
|
||||||
if node_ids.length > 0
|
if node_ids.length > 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue