X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/550ebc6c82e065461ad50f52c50cade040c33648..97aefa23d0606edaee71d04cf6c1a2006689b1fa:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 359b45326..11ddc3f7c 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -123,7 +123,9 @@ 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] } # 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 + relations = nodes_in_area.collect { |node| node.containing_relations.visible }.flatten + + way_ids.collect { |id| Way.find(id).containing_relations.visible }.flatten + relation_ids = relations.collect { |relation| relation.id }.uniq [way_ids,points,relation_ids] end