Sha256: ead7ae68b1ae32051b6560550d19220ac1a550547c520f65d7bc10b5ac7b4201

Contents?: true

Size: 697 Bytes

Versions: 7

Compression:

Stored size: 697 Bytes

Contents

require_relative './helper'

describe Terraformer::ConvexHull do

  EXAMPLES.not(:multi_line_string).each do |key, geo|
    it "works on #{key}" do
      ch = Terraformer.parse(geo).convex_hull
      ch.dont_be_terrible_ok
      ch.must_be_valid_geojson
    end
  end

  it 'raises without enough points' do
    ->{ Terraformer.parse(EXAMPLES[:multi_line_string]).convex_hull }.must_raise ArgumentError
  end

  it 'works on feature collections' do
    fc = Terraformer::FeatureCollection.new
    fc << Terraformer.parse(EXAMPLES[:waldocanyon])
    fc << Terraformer.parse(EXAMPLES[:sf_county]).to_feature
    ch = fc.convex_hull
    ch.dont_be_terrible_ok
    ch.must_be_valid_geojson
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
terraformer-0.0.9 test/convex_hull_spec.rb
terraformer-0.0.8 test/convex_hull_spec.rb
terraformer-0.0.7 test/convex_hull_spec.rb
terraformer-0.0.6 test/convex_hull_spec.rb
terraformer-0.0.4 test/convex_hull_spec.rb
terraformer-0.0.3 test/convex_hull_spec.rb
terraformer-0.0.2 test/convex_hull_spec.rb