class NSWTopo::Labels::Fence
Attributes
index[R]
Public Class Methods
new(segment, buffer: 0, index:)
click to toggle source
# File lib/nswtopo/layer/labels/fence.rb, line 4 def initialize(segment, buffer: 0, index:) @segment, @buffer, @index = segment, buffer, index end
Public Instance Methods
bounds()
click to toggle source
# File lib/nswtopo/layer/labels/fence.rb, line 9 def bounds @segment.transpose.map(&:minmax).map do |min, max| [min - @buffer, max + @buffer] end end
conflicts_with?(segment, buffer = 0)
click to toggle source
# File lib/nswtopo/layer/labels/fence.rb, line 15 def conflicts_with?(segment, buffer = 0) [@segment, segment].overlap?(@buffer + buffer) end