Class: DouglasPeucker::LineSimplifier

Inherits:
Object
  • Object
show all
Defined in:
lib/douglas_peucker/line_simplifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(points) ⇒ LineSimplifier

Returns a new instance of LineSimplifier.



4
5
6
7
# File 'lib/douglas_peucker/line_simplifier.rb', line 4

def initialize(points)
  @points = points
  @threshold = 10e-8
end

Instance Method Details

#pointsObject



14
15
16
# File 'lib/douglas_peucker/line_simplifier.rb', line 14

def points
  calculate_points(@points)
end

#threshold(threshold) ⇒ Object



9
10
11
12
# File 'lib/douglas_peucker/line_simplifier.rb', line 9

def threshold(threshold)
  @threshold = threshold
  self
end