Skip to content

Releases: odlp/simplify_rb

Enumerable raw_points

20 Sep 18:57
Compare
Choose a tag to compare

Allows any Enumerable to be provided, not just an Array. This means ActiveRecord::Relation can be passed in for example. [@nTraum via #4]

Supporting custom types

28 Aug 11:22
Compare
Choose a tag to compare

The v0.3.0 release adds two features:

1. The original point is now returned in the optimised results.

This means additional data is preserved. For example, prior to this change attributes like note on this hash had not been returned:

{ x: 51.5256, y: -0.0875, note: 'My note' }

2. You can now use custom point objects, rather than just hashes.

Your custom points just need to respond to :x and :y, e.g:

CustomPointStruct = Struct.new(:id, :x, :y, :description)

API changes

29 Jul 21:01
Compare
Choose a tag to compare

This release includes breaking changes. The main change is a transition from class methods to instance methods.

Before:

SimplifyRb.simplify(points, tolerance, high_quality)

After:

SimplifyRb::Simplifier.new.process(points, tolerance, high_quality)

This release is available on RubyGems.