Class: SimplifyRb::DouglasPeuckerSimplifier

Inherits:
Object
  • Object
show all
Defined in:
lib/simplify_rb/douglas_peucker_simplifier.rb

Defined Under Namespace

Classes: MaxSqDist

Instance Method Summary collapse

Instance Method Details

#process(points, sq_tolerance) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/simplify_rb/douglas_peucker_simplifier.rb', line 5

def process(points, sq_tolerance)
  points.first.keep = true
  points.last.keep  = true

  simplify_douglas_peucker(points, sq_tolerance)
    .select(&:keep)
end