Sha256: 7751b2abd8a2a009805caf780d6aacc14ab5b9b88d06cc9a7b0689963f8ed6f9

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe GeoRuby::SimpleFeatures::LinearRing do

  it "should instantiate" do
    lr = GeoRuby::SimpleFeatures::LinearRing.new(4326)
    lr.should be_instance_of(GeoRuby::SimpleFeatures::LinearRing)
  end

  describe "Instance" do

    let(:lr) { GeoRuby::SimpleFeatures::LinearRing.from_coordinates([[10,10],[20,45],[45,10],[10, 10]],256) }

    it "should test if contains a point" do
      lr.contains_point?(GeoRuby::SimpleFeatures::Point.from_x_y(21,21)).should be_true
    end

    it "should test if not contains a point" do
      lr.contains_point?(GeoRuby::SimpleFeatures::Point.from_x_y(21,51)).should be_false
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
georuby-2.2.1 spec/geo_ruby/simple_features/linear_ring_spec.rb
georuby-2.2.0 spec/geo_ruby/simple_features/linear_ring_spec.rb
georuby-2.0.0 spec/geo_ruby/simple_features/linear_ring_spec.rb