- # Fetch any segments needed for our ways (only have matching segments so far)
- segments += Segment.find(ways.collect { |w| w.segs }.uniq)
-
- # Fetch any nodes needed for our segments (only have matching nodes so far)
- nodes += Node.find(segments.collect { |s| [s.node_a, s.node_b] }.flatten.uniq)
+ # Fetch any node needed for our ways (only have matching nodes so far)
+ nodes += Node.find(ways.collect { |w| w.nds }.uniq)