Sha256: eaa639126577b2ae79aa0d2fb9e9c17aa880362ca397dd7a0a1cdd13214576a3

Contents?: true

Size: 1.79 KB

Versions: 13

Compression:

Stored size: 1.79 KB

Contents

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

describe MultiPoint do

  it "test_multi_point_creation" do
    multi_point = MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444)
    multi_point.should be_instance_of(MultiPoint)
    multi_point.length.should eql(3)
    multi_point[0].should == Point.from_x_y(12.4,-123.3,444)
    multi_point[2].should == Point.from_x_y(123.55555555,123,444)
  end

  it "test_multi_point_binary" do
    multi_point = MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444)
    multi_point.as_hex_ewkb.should eql("0104000020BC010000030000000101000000CDCCCCCCCCCC28403333333333D35EC0010100000066666666664650C09A99999999D95E4001010000001F97DD388EE35E400000000000C05E40")

    multi_point = MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,1.2],[123.55555555,123,2.3]],444,true)
    multi_point.as_hex_ewkb.should eql("01040000A0BC010000030000000101000080CDCCCCCCCCCC28403333333333D35EC00000000000001240010100008066666666664650C09A99999999D95E40333333333333F33F01010000801F97DD388EE35E400000000000C05E406666666666660240")
  end

  it "test_multi_point_text" do
    multi_point = MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444)
    multi_point.as_ewkt.should eql("SRID=444;MULTIPOINT((12.4 -123.3),(-65.1 123.4),(123.55555555 123))")

    multi_point = MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,6.7],[123.55555555,123,7.8]],444,true)
    multi_point.as_ewkt.should eql("SRID=444;MULTIPOINT((12.4 -123.3 4.5),(-65.1 123.4 6.7),(123.55555555 123 7.8))")
  end

  it "should respond to points" do
    mp = MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444)
    mp.should have(3).geometries
    mp.should have(3).points
  end

end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
georuby-1.9.9 spec/geo_ruby/simple_features/multi_point_spec.rb
georuby-1.9.8 spec/geo_ruby/simple_features/multi_point_spec.rb
georuby-1.9.7 spec/geo_ruby/simple_features/multi_point_spec.rb
georuby-1.9.6 spec/geo_ruby/simple_features/multi_point_spec.rb
georuby-1.9.5 spec/geo_ruby/simple_features/multi_point_spec.rb
georuby-1.9.3 spec/geo_ruby/simple_features/multi_point_spec.rb
nofxx-georuby-1.9.2 spec/geo_ruby/simple_features/multi_point_spec.rb
nofxx-georuby-1.9.1 spec/geo_ruby/simple_features/multi_point_spec.rb
nofxx-georuby-1.9.0 spec/geo_ruby/simple_features/multi_point_spec.rb
nofxx-georuby-1.7.3 spec/geo_ruby/simple_features/multi_point_spec.rb
georuby_remake-1.0.0 spec/geo_ruby/simple_features/multi_point_spec.rb
ppe-georuby-1.7.2 spec/geo_ruby/simple_features/multi_point_spec.rb
nofxx-georuby-1.7.1 spec/geo_ruby/simple_features/multi_point_spec.rb