Sha256: 910fa47ffb2c0c12d28c68686cf5741865f2e881293a5c4aeec6b50f434d6dd8

Contents?: true

Size: 755 Bytes

Versions: 3

Compression:

Stored size: 755 Bytes

Contents

require 'spec_helper'
require 'geo_ruby'

describe "PointInPolygon" do
  describe "Added point" do
    it "is in the polygon" do
      polygon = GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[25.774252, -80.190262], [18.466465, -66.118292],[32.321384, -64.75737],[25.774252, -80.190262]]])
      polygon.includes?( GeoRuby::SimpleFeatures::Point.from_coordinates([25.774252, -70.190261]) ).should == true
    end

    it "is not in the polygon" do
      polygon = GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[25.774252, -80.190262], [18.466465, -66.118292],[32.321384, -64.75737],[25.774252, -80.190262]]])
      polygon.includes?( GeoRuby::SimpleFeatures::Point.from_coordinates([25.774252, -65.190261]) ).should == false
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geomagic-0.0.3 spec/geomagic/point_in_polygon_spec.rb
geomagic-0.0.2 spec/geomagic/point_in_polygon_spec.rb
geomagic-0.0.1.alpha spec/geomagic/point_in_polygon_spec.rb