Sha256: 3ca1393980f65f30de8777e1fa24cadedbbb5d722f0d7ab2e5c253a7a351ec48

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require "spec_helper"

describe  GeoRuby::SimpleFeatures::MultiPolygon do
  
  describe "#to_wgs84" do
    
    let(:polygon_google) {polygon(point(0,0), point(0,1), point(1,0), point(0,0))}
    let(:polygon_wgs84) { GeoRuby::SimpleFeatures::Polygon.from_points([[point(0, 0, 4326), point(0, 0.000008983152840993819, 4326), point(0.000008983152841195214, 0, 4326), point(0, 0, 4326)]], 4326)} 
    let(:multi_polygon_google) {multi_polygon(polygon_google, polygon_google)}
    let(:multi_polygon_wgs84) {GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([polygon_wgs84, polygon_wgs84], 4326)}
    
    it "should return a polygon in wgs84 coordinates" do
      multi_polygon_google.to_wgs84.should == multi_polygon_wgs84
    end

    it "should return same srid" do
      multi_polygon_google.to_wgs84.srid.should == multi_polygon_wgs84.srid
    end
  end

  describe "#polygons" do
    let(:georuby_polygon){ polygon(point(0.0,0.0), point(0.0,2.0), point(2.0,2.0), point(2.0,0.0), point(0.0,0.0))} 
    let(:georuby_multi_polygon){multi_polygon(georuby_polygon, georuby_polygon)}  
    it "should return an array of polygons" do
      georuby_multi_polygon.polygons.should == [georuby_polygon, georuby_polygon]
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georuby-ext-0.0.1 spec/georuby/multi_polygon_spec.rb