georuby 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -8
  3. data/lib/geo_ruby/geojson.rb +8 -6
  4. data/lib/geo_ruby/simple_features/geometry.rb +11 -0
  5. data/lib/geo_ruby/simple_features/geometry_collection.rb +1 -9
  6. data/lib/geo_ruby/simple_features/line_string.rb +8 -13
  7. data/lib/geo_ruby/simple_features/multi_line_string.rb +2 -10
  8. data/lib/geo_ruby/simple_features/multi_point.rb +1 -9
  9. data/lib/geo_ruby/simple_features/multi_polygon.rb +0 -7
  10. data/lib/geo_ruby/simple_features/point.rb +11 -14
  11. data/lib/geo_ruby/simple_features/polygon.rb +1 -9
  12. data/lib/geo_ruby/version.rb +1 -1
  13. data/spec/geo_ruby/geojson_spec.rb +25 -25
  14. data/spec/geo_ruby/georss_spec.rb +63 -63
  15. data/spec/geo_ruby/gpx4r/gpx_spec.rb +34 -34
  16. data/spec/geo_ruby/kml_spec.rb +27 -27
  17. data/spec/geo_ruby/shp4r/shp_spec.rb +46 -46
  18. data/spec/geo_ruby/simple_features/circle_spec.rb +1 -1
  19. data/spec/geo_ruby/simple_features/envelope_spec.rb +15 -15
  20. data/spec/geo_ruby/simple_features/ewkb_parser_spec.rb +56 -56
  21. data/spec/geo_ruby/simple_features/ewkt_parser_spec.rb +68 -68
  22. data/spec/geo_ruby/simple_features/geometry_collection_spec.rb +18 -18
  23. data/spec/geo_ruby/simple_features/geometry_spec.rb +10 -10
  24. data/spec/geo_ruby/simple_features/line_string_spec.rb +80 -71
  25. data/spec/geo_ruby/simple_features/linear_ring_spec.rb +3 -3
  26. data/spec/geo_ruby/simple_features/multi_line_string_spec.rb +15 -15
  27. data/spec/geo_ruby/simple_features/multi_point_spec.rb +10 -10
  28. data/spec/geo_ruby/simple_features/multi_polygon_spec.rb +13 -13
  29. data/spec/geo_ruby/simple_features/point_spec.rb +139 -131
  30. data/spec/geo_ruby/simple_features/polygon_spec.rb +36 -36
  31. data/spec/geo_ruby_spec.rb +3 -3
  32. data/spec/spec_helper.rb +4 -4
  33. metadata +52 -52
@@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
4
4
  describe GeoRuby::SimpleFeatures::Circle do
5
5
 
6
6
  it "should instantiate" do
7
- subject.should be_kind_of GeoRuby::SimpleFeatures::Geometry
7
+ expect(subject).to be_kind_of GeoRuby::SimpleFeatures::Geometry
8
8
  end
9
9
 
10
10
  describe "Instance" do
@@ -7,7 +7,7 @@ describe GeoRuby::SimpleFeatures::Envelope do
7
7
  end
8
8
 
9
9
  it "should initialize" do
10
- @env.should be_instance_of(GeoRuby::SimpleFeatures::Envelope)
10
+ expect(@env).to be_instance_of(GeoRuby::SimpleFeatures::Envelope)
11
11
  end
12
12
 
13
13
  it "converted tu" do
@@ -15,33 +15,33 @@ describe GeoRuby::SimpleFeatures::Envelope do
15
15
  polygon = GeoRuby::SimpleFeatures::Polygon.from_linear_rings([linear_ring],256)
16
16
  e = polygon.envelope
17
17
 
18
- e.lower_corner.class.should eql(GeoRuby::SimpleFeatures::Point)
19
- e.upper_corner.class.should eql(GeoRuby::SimpleFeatures::Point)
18
+ expect(e.lower_corner.class).to eql(GeoRuby::SimpleFeatures::Point)
19
+ expect(e.upper_corner.class).to eql(GeoRuby::SimpleFeatures::Point)
20
20
 
21
- e.lower_corner.x.should eql(4.456)
22
- e.lower_corner.y.should eql(-45.3)
23
- e.upper_corner.x.should eql(45.4)
24
- e.upper_corner.y.should eql(41.6)
21
+ expect(e.lower_corner.x).to eql(4.456)
22
+ expect(e.lower_corner.y).to eql(-45.3)
23
+ expect(e.upper_corner.x).to eql(45.4)
24
+ expect(e.upper_corner.y).to eql(41.6)
25
25
 
26
26
  line_string = GeoRuby::SimpleFeatures::LineString.from_coordinates([[13.6,-49.3],[45.4,44.6],[14.2,1.09],[13.6,-49.3]],256)
27
27
  e2 = line_string.envelope
28
28
 
29
29
  e3 = e.extend(e2)
30
30
 
31
- e3.lower_corner.x.should eql(4.456)
32
- e3.lower_corner.y.should eql(-49.3)
33
- e3.upper_corner.x.should eql(45.4)
34
- e3.upper_corner.y.should eql(44.6)
31
+ expect(e3.lower_corner.x).to eql(4.456)
32
+ expect(e3.lower_corner.y).to eql(-49.3)
33
+ expect(e3.upper_corner.x).to eql(45.4)
34
+ expect(e3.upper_corner.y).to eql(44.6)
35
35
  end
36
36
 
37
37
  it "should have a center" do
38
- @env.center.x.should eql(15)
39
- @env.center.y.should eql(25)
40
- @env.center.srid.should eql(@env.srid)
38
+ expect(@env.center.x).to eql(15)
39
+ expect(@env.center.y).to eql(25)
40
+ expect(@env.center.srid).to eql(@env.srid)
41
41
  end
42
42
 
43
43
  it "should print a kml_representation" do
44
- @env.as_kml.should eql("<LatLonAltBox>\n<north>30</north>\n<south>20</south>\n<east>20</east>\n<west>10</west>\n</LatLonAltBox>\n")
44
+ expect(@env.as_kml).to eql("<LatLonAltBox>\n<north>30</north>\n<south>20</south>\n<east>20</east>\n<west>10</west>\n</LatLonAltBox>\n")
45
45
  end
46
46
 
47
47
  end
@@ -10,149 +10,149 @@ describe GeoRuby::SimpleFeatures::EWKBParser do
10
10
  it "test_point2d" do
11
11
  @hex_ewkb_parser.parse("01010000207B000000CDCCCCCCCCCC28406666666666A64640")
12
12
  point = @factory.geometry
13
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
14
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y(12.4,45.3,123)
13
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
14
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y(12.4, 45.3, 123))
15
15
  end
16
16
 
17
17
  it "test_point2d_BigEndian" do
18
18
  @hex_ewkb_parser.parse("00000000014013A035BD512EC7404A3060C38F3669")
19
19
  point = @factory.geometry
20
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
21
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y(4.906455,52.377953)
20
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
21
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y(4.906455, 52.377953))
22
22
  end
23
23
 
24
24
  it "test_point3dz" do
25
25
  @hex_ewkb_parser.parse("01010000A07B000000CDCCCCCCCCCC28406666666666A646400000000000000CC0")
26
26
  point = @factory.geometry
27
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
28
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y_z(12.4,45.3,-3.5,123)
27
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
28
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y_z(12.4, 45.3, -3.5, 123))
29
29
  end
30
30
 
31
31
  it "test_point4d" do
32
32
  @hex_ewkb_parser.parse("01010000E07B000000CDCCCCCCCCCC28406666666666A646400000000000000CC00000000000002E40")
33
33
  point = @factory.geometry
34
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
35
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y_z_m(12.4,45.3,-3.5,15,123)
34
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
35
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y_z_m(12.4, 45.3, -3.5, 15, 123))
36
36
  end
37
37
 
38
38
  it "test_line_string" do
39
39
  @hex_ewkb_parser.parse("01020000200001000002000000CDCCCCCCCCCC28406666666666A646C03333333333B34640CDCCCCCCCCCC4440")
40
40
  line_string = @factory.geometry
41
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
42
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3],[45.4,41.6]],256)
41
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
42
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3],[45.4,41.6]],256))
43
43
 
44
44
  @hex_ewkb_parser.parse("01020000A00001000002000000CDCCCCCCCCCC28406666666666A646C06666666666A641403333333333B34640CDCCCCCCCCCC44409A99999999992840")
45
45
  line_string = @factory.geometry
46
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
47
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3],[45.4,41.6,12.3]],256,true)
46
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
47
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3],[45.4,41.6,12.3]],256,true))
48
48
 
49
49
  @hex_ewkb_parser.parse("01020000E00001000002000000CDCCCCCCCCCC28406666666666A646C06666666666A64140CDCCCCCCCC8C46403333333333B34640CDCCCCCCCCCC44409A999999999928403D0AD7A3701D4440")
50
50
  line_string = @factory.geometry
51
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
52
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3,45.1],[45.4,41.6,12.3,40.23]],256,true,true)
51
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
52
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3,45.1],[45.4,41.6,12.3,40.23]],256,true,true))
53
53
  end
54
54
 
55
55
  it "test_polygon" do
56
56
  @hex_ewkb_parser.parse("0103000020000100000200000005000000000000000000000000000000000000000000000000001040000000000000000000000000000010400000000000001040000000000000000000000000000010400000000000000000000000000000000005000000000000000000F03F000000000000F03F0000000000000840000000000000F03F00000000000008400000000000000840000000000000F03F0000000000000840000000000000F03F000000000000F03F")
57
57
  polygon = @factory.geometry
58
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
59
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)
58
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
59
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256))
60
60
 
61
61
  @hex_ewkb_parser.parse("01030000A000010000020000000500000000000000000000000000000000000000000000000000004000000000000010400000000000000000000000000000004000000000000010400000000000001040000000000000004000000000000000000000000000001040000000000000004000000000000000000000000000000000000000000000004005000000000000000000F03F000000000000F03F00000000000000400000000000000840000000000000F03F0000000000000040000000000000084000000000000008400000000000000040000000000000F03F00000000000008400000000000000040000000000000F03F000000000000F03F0000000000000040")
62
62
  polygon = @factory.geometry
63
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
64
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,true)
63
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
64
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,true))
65
65
 
66
66
  @hex_ewkb_parser.parse("010300006000010000020000000500000000000000000000000000000000000000000000000000004000000000000010400000000000000000000000000000004000000000000010400000000000001040000000000000004000000000000000000000000000001040000000000000004000000000000000000000000000000000000000000000004005000000000000000000F03F000000000000F03F00000000000000400000000000000840000000000000F03F0000000000000040000000000000084000000000000008400000000000000040000000000000F03F00000000000008400000000000000040000000000000F03F000000000000F03F0000000000000040")
67
67
  polygon = @factory.geometry
68
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
69
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,false,true)
68
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
69
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,false,true))
70
70
 
71
71
  @hex_ewkb_parser.parse("01030000E0000100000200000005000000000000000000000000000000000000000000000000000040CDCCCCCCCC8C46C00000000000001040000000000000000000000000000000400000000000001440000000000000104000000000000010400000000000000040AE47E17A14AE1240000000000000000000000000000010400000000000000040713D0AD7A370F53F000000000000000000000000000000000000000000000040CDCCCCCCCC8C46C005000000000000000000F03F000000000000F03F00000000000000409A999999999928400000000000000840000000000000F03F00000000000000400000000000C05E400000000000000840000000000000084000000000000000406666666666662840000000000000F03F000000000000084000000000000000400000000000002840000000000000F03F000000000000F03F00000000000000409A99999999992840")
72
72
  polygon = @factory.geometry
73
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
74
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2,-45.1],[4,0,2,5],[4,4,2,4.67],[0,4,2,1.34],[0,0,2,-45.1]],[[1,1,2,12.3],[3,1,2,123],[3,3,2,12.2],[1,3,2,12],[1,1,2,12.3]]],256,true,true)
73
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
74
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2,-45.1],[4,0,2,5],[4,4,2,4.67],[0,4,2,1.34],[0,0,2,-45.1]],[[1,1,2,12.3],[3,1,2,123],[3,3,2,12.2],[1,3,2,12],[1,1,2,12.3]]],256,true,true))
75
75
  end
76
76
 
77
77
  it "test_geometry_collection" do
78
78
  @hex_ewkb_parser.parse("010700002000010000020000000101000000AE47E17A14AE12403333333333B34640010200000002000000CDCCCCCCCCCC16406666666666E628403333333333E350400000000000004B40")
79
79
  geometry_collection = @factory.geometry
80
- geometry_collection.should be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
80
+ expect(geometry_collection).to be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
81
81
 
82
- geometry_collection.should == GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y(4.67,45.4,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45],[67.55,54]],256)],256)
83
- geometry_collection[0].srid.should eql(256)
82
+ expect(geometry_collection).to eq(GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y(4.67,45.4,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45],[67.55,54]],256)],256))
83
+ expect(geometry_collection[0].srid).to eql(256)
84
84
 
85
85
  @hex_ewkb_parser.parse("01070000E0000100000200000001010000C0AE47E17A14AE12403333333333B34640F6285C8FC2D54640666666666666024001020000C002000000CDCCCCCCCCCC16406666666666E628403D0AD7A3703D124033333333339358403333333333E350400000000000004B4066666666666628403333333333330B40")
86
86
  geometry_collection = @factory.geometry
87
- geometry_collection.should be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
88
- geometry_collection.should == GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y_z_m(4.67,45.4,45.67,2.3,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45,4.56,98.3],[67.55,54,12.2,3.4]],256,true, true)],256,true, true)
89
- geometry_collection[0].srid.should eql(256)
87
+ expect(geometry_collection).to be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
88
+ expect(geometry_collection).to eq(GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y_z_m(4.67,45.4,45.67,2.3,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45,4.56,98.3],[67.55,54,12.2,3.4]],256,true, true)],256,true, true))
89
+ expect(geometry_collection[0].srid).to eql(256)
90
90
  end
91
91
 
92
92
  it "test_multi_point" do
93
93
  @hex_ewkb_parser.parse("0104000020BC010000030000000101000000CDCCCCCCCCCC28403333333333D35EC0010100000066666666664650C09A99999999D95E4001010000001F97DD388EE35E400000000000C05E40")
94
94
  multi_point = @factory.geometry
95
- multi_point.should be_instance_of GeoRuby::SimpleFeatures::MultiPoint
96
- multi_point.should == GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444)
97
- multi_point.srid.should eql(444)
98
- multi_point[0].srid.should eql(444)
95
+ expect(multi_point).to be_instance_of GeoRuby::SimpleFeatures::MultiPoint
96
+ expect(multi_point).to eq(GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444))
97
+ expect(multi_point.srid).to eql(444)
98
+ expect(multi_point[0].srid).to eql(444)
99
99
 
100
100
  @hex_ewkb_parser.parse("01040000A0BC010000030000000101000080CDCCCCCCCCCC28403333333333D35EC00000000000001240010100008066666666664650C09A99999999D95E40333333333333F33F01010000801F97DD388EE35E400000000000C05E406666666666660240")
101
101
  multi_point = @factory.geometry
102
- multi_point.should be_instance_of GeoRuby::SimpleFeatures::MultiPoint
103
- multi_point.should == GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,1.2],[123.55555555,123,2.3]],444,true)
104
- multi_point.srid.should eql(444)
105
- multi_point[0].srid.should eql(444)
102
+ expect(multi_point).to be_instance_of GeoRuby::SimpleFeatures::MultiPoint
103
+ expect(multi_point).to eq(GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,1.2],[123.55555555,123,2.3]],444,true))
104
+ expect(multi_point.srid).to eql(444)
105
+ expect(multi_point[0].srid).to eql(444)
106
106
  end
107
107
 
108
108
  it "test_multi_line_string" do
109
109
  @hex_ewkb_parser.parse("01050000200001000002000000010200000002000000000000000000F83F9A99999999994640E4BD6A65C20F4BC0FA7E6ABC749388BF010200000003000000000000000000F83F9A99999999994640E4BD6A65C20F4BC0FA7E6ABC749388BF39B4C876BE8F46403333333333D35E40")
110
110
  multi_line_string = @factory.geometry
111
- multi_line_string.should be_instance_of GeoRuby::SimpleFeatures::MultiLineString
112
- multi_line_string.should == GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012]],256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012],[45.123,123.3]],256)],256)
113
- multi_line_string.srid.should eql(256)
114
- multi_line_string[0].srid.should eql(256)
111
+ expect(multi_line_string).to be_instance_of GeoRuby::SimpleFeatures::MultiLineString
112
+ expect(multi_line_string).to eq(GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012]],256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012],[45.123,123.3]],256)],256))
113
+ expect(multi_line_string.srid).to eql(256)
114
+ expect(multi_line_string[0].srid).to eql(256)
115
115
 
116
116
  @hex_ewkb_parser.parse("0105000020000100000200000001020000C002000000000000000000F83F9A99999999994640CDCCCCCCCCCCF43F333333333333F33FE4BD6A65C20F4BC0FA7E6ABC749388BF333333333333F33F000000000000124001020000C003000000000000000000F83F9A99999999994640666666666666144000000000000012C0E4BD6A65C20F4BC0FA7E6ABC749388BF3333333333331BC03333333333330B4039B4C876BE8F46403333333333D35E40000000000000124033333333333315C0")
117
117
  multi_line_string = @factory.geometry
118
- multi_line_string.should be_instance_of GeoRuby::SimpleFeatures::MultiLineString
119
- multi_line_string.should == GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,1.3,1.2],[-54.12312,-0.012,1.2,4.5]],256,true,true),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,5.1,-4.5],[-54.12312,-0.012,-6.8,3.4],[45.123,123.3,4.5,-5.3]],256,true,true)],256,true,true)
120
- multi_line_string.srid.should eql(256)
121
- multi_line_string[0].srid.should eql(256)
118
+ expect(multi_line_string).to be_instance_of GeoRuby::SimpleFeatures::MultiLineString
119
+ expect(multi_line_string).to eq(GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,1.3,1.2],[-54.12312,-0.012,1.2,4.5]],256,true,true),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,5.1,-4.5],[-54.12312,-0.012,-6.8,3.4],[45.123,123.3,4.5,-5.3]],256,true,true)],256,true,true))
120
+ expect(multi_line_string.srid).to eql(256)
121
+ expect(multi_line_string[0].srid).to eql(256)
122
122
  end
123
123
 
124
124
  it "test_multi_polygon" do
125
125
  @hex_ewkb_parser.parse("0106000020000100000200000001030000000200000004000000CDCCCCCCCCCC28406666666666A646C03333333333B34640CDCCCCCCCCCC44406DE7FBA9F1D211403D2CD49AE61DF13FCDCCCCCCCCCC28406666666666A646C004000000333333333333034033333333333315409A999999999915408A8EE4F21FD2F63FEC51B81E85EB2C40F6285C8FC2F5F03F3333333333330340333333333333154001030000000200000005000000000000000000000000000000000000000000000000001040000000000000000000000000000010400000000000001040000000000000000000000000000010400000000000000000000000000000000005000000000000000000F03F000000000000F03F0000000000000840000000000000F03F00000000000008400000000000000840000000000000F03F0000000000000840000000000000F03F000000000000F03F")
126
126
  multi_polygon = @factory.geometry
127
- multi_polygon.should be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
128
- multi_polygon.should == GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3],[45.4,41.6],[4.456,1.0698],[12.4,-45.3]],[[2.4,5.3],[5.4,1.4263],[14.46,1.06],[2.4,5.3]]],256),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)],256)
129
- multi_polygon.srid.should eql(256)
130
- multi_polygon[0].srid.should eql(256)
127
+ expect(multi_polygon).to be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
128
+ expect(multi_polygon).to eq(GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3],[45.4,41.6],[4.456,1.0698],[12.4,-45.3]],[[2.4,5.3],[5.4,1.4263],[14.46,1.06],[2.4,5.3]]],256),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)],256))
129
+ expect(multi_polygon.srid).to eql(256)
130
+ expect(multi_polygon[0].srid).to eql(256)
131
131
 
132
132
  @hex_ewkb_parser.parse("0106000020000100000200000001030000400200000004000000CDCCCCCCCCCC28406666666666A646C0333333333333F33F3333333333B34640CDCCCCCCCCCC4440333333333333F33F6DE7FBA9F1D211403D2CD49AE61DF13F333333333333F33FCDCCCCCCCCCC28406666666666A646C0333333333333F33F0400000033333333333303403333333333331540333333333333F33F9A999999999915408A8EE4F21FD2F63F333333333333F33FEC51B81E85EB2C40F6285C8FC2F5F03F333333333333F33F33333333333303403333333333331540333333333333F33F0103000040020000000500000000000000000000000000000000000000333333333333F33F00000000000010400000000000000000333333333333F33F00000000000010400000000000001040666666666666024000000000000000000000000000001040333333333333F33F00000000000000000000000000000000333333333333F33F05000000000000000000F03F000000000000F03F9A999999999901400000000000000840000000000000F03F6666666666660A40000000000000084000000000000008409A9999999999F13F000000000000F03F00000000000008403333333333330340000000000000F03F000000000000F03F9A99999999990140")
133
133
  multi_polygon = @factory.geometry
134
- multi_polygon.should be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
135
- multi_polygon.should == GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3,1.2],[45.4,41.6,1.2],[4.456,1.0698,1.2],[12.4,-45.3,1.2]],[[2.4,5.3,1.2],[5.4,1.4263,1.2],[14.46,1.06,1.2],[2.4,5.3,1.2]]],256,false,true),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,1.2],[4,0,1.2],[4,4,2.3],[0,4,1.2],[0,0,1.2]],[[1,1,2.2],[3,1,3.3],[3,3,1.1],[1,3,2.4],[1,1,2.2]]],256,false,true)],256,false,true)
136
- multi_polygon.srid.should eql(256)
137
- multi_polygon[0].srid.should eql(256)
134
+ expect(multi_polygon).to be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
135
+ expect(multi_polygon).to eq(GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3,1.2],[45.4,41.6,1.2],[4.456,1.0698,1.2],[12.4,-45.3,1.2]],[[2.4,5.3,1.2],[5.4,1.4263,1.2],[14.46,1.06,1.2],[2.4,5.3,1.2]]],256,false,true),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,1.2],[4,0,1.2],[4,4,2.3],[0,4,1.2],[0,0,1.2]],[[1,1,2.2],[3,1,3.3],[3,3,1.1],[1,3,2.4],[1,1,2.2]]],256,false,true)],256,false,true))
136
+ expect(multi_polygon.srid).to eql(256)
137
+ expect(multi_polygon[0].srid).to eql(256)
138
138
  end
139
139
 
140
140
 
141
141
  it "test_failure_trailing_data" do
142
142
  #added A345 at the end
143
- lambda {@hex_ewkb_parser.parse("01010000207B000000CDCCCCCCCCCC28406666666666A64640A345")}.should raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
143
+ expect {@hex_ewkb_parser.parse("01010000207B000000CDCCCCCCCCCC28406666666666A64640A345")}.to raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
144
144
  end
145
145
 
146
146
  it "test_failure_unknown_geometry_type" do
147
- lambda {@hex_ewkb_parser.parse("01090000207B000000CDCCCCCCCCCC28406666666666A64640")}.should raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
147
+ expect {@hex_ewkb_parser.parse("01090000207B000000CDCCCCCCCCCC28406666666666A64640")}.to raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
148
148
  end
149
149
 
150
150
  it "test_failure_m" do
151
- lambda {@hex_ewkb_parser.parse("01010000607B000000CDCCCCCCCCCC28406666666666A64640")}.should raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
151
+ expect {@hex_ewkb_parser.parse("01010000607B000000CDCCCCCCCCCC28406666666666A64640")}.to raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
152
152
  end
153
153
 
154
154
  it "test_failure_truncated_data" do
155
- lambda {@hex_ewkb_parser.parse("01010000207B000000CDCCCCCCCCCC2840666666")}.should raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
155
+ expect {@hex_ewkb_parser.parse("01010000207B000000CDCCCCCCCCCC2840666666")}.to raise_error(GeoRuby::SimpleFeatures::EWKBFormatError)
156
156
  end
157
157
 
158
158
  end
@@ -11,169 +11,169 @@ describe GeoRuby::SimpleFeatures::EWKTParser do
11
11
  ewkt="POINT( 3.456 0.123)"
12
12
  @ewkt_parser.parse(ewkt)
13
13
  point = @factory.geometry
14
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
15
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y(3.456,0.123)
14
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
15
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y(3.456,0.123))
16
16
  end
17
17
 
18
18
  it "test_point_with_srid" do
19
19
  ewkt="SRID=245;POINT(0.0 2.0)"
20
20
  @ewkt_parser.parse(ewkt)
21
21
  point = @factory.geometry
22
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
23
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y(0,2,245)
24
- point.srid.should eql(245)
25
- ewkt.should == point.as_ewkt(true,false)
22
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
23
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y(0,2,245))
24
+ expect(point.srid).to eql(245)
25
+ expect(ewkt).to eq(point.as_ewkt(true,false))
26
26
  end
27
27
 
28
28
  it "test_point3dz" do
29
29
  ewkt="POINT(3.456 0.123 123.667)"
30
30
  @ewkt_parser.parse(ewkt)
31
31
  point = @factory.geometry
32
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
33
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y_z(3.456,0.123,123.667)
34
- ewkt.should == point.as_ewkt(false)
32
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
33
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y_z(3.456,0.123,123.667))
34
+ expect(ewkt).to eq(point.as_ewkt(false))
35
35
  end
36
36
 
37
37
  it "test_point3dm" do
38
38
  ewkt="POINTM(3.456 0.123 123.667)"
39
39
  @ewkt_parser.parse(ewkt)
40
40
  point = @factory.geometry
41
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
42
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y_m(3.456,0.123,123.667)
43
- ewkt.should == point.as_ewkt(false)
41
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
42
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y_m(3.456,0.123,123.667))
43
+ expect(ewkt).to eq(point.as_ewkt(false))
44
44
  end
45
45
 
46
46
  it "test_point4d" do
47
47
  ewkt="POINT(3.456 0.123 123.667 15.0)"
48
48
  @ewkt_parser.parse(ewkt)
49
49
  point = @factory.geometry
50
- point.should be_instance_of GeoRuby::SimpleFeatures::Point
51
- point.should == GeoRuby::SimpleFeatures::Point.from_x_y_z_m(3.456,0.123,123.667,15.0)
52
- ewkt.should == point.as_ewkt(false)
50
+ expect(point).to be_instance_of GeoRuby::SimpleFeatures::Point
51
+ expect(point).to eq(GeoRuby::SimpleFeatures::Point.from_x_y_z_m(3.456,0.123,123.667,15.0))
52
+ expect(ewkt).to eq(point.as_ewkt(false))
53
53
  end
54
54
 
55
55
 
56
56
  it "test_linestring" do
57
57
  @ewkt_parser.parse("LINESTRING(3.456 0.123,123.44 123.56,54555.22 123.3)")
58
58
  line_string = @factory.geometry
59
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
60
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[3.456,0.123],[123.44,123.56],[54555.22,123.3]])
59
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
60
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[3.456,0.123],[123.44,123.56],[54555.22,123.3]]))
61
61
 
62
62
  @ewkt_parser.parse("SRID=256;LINESTRING(12.4 -45.3,45.4 41.6)")
63
63
  line_string = @factory.geometry
64
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
65
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3],[45.4,41.6]],256)
64
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
65
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3],[45.4,41.6]],256))
66
66
 
67
67
  @ewkt_parser.parse("SRID=256;LINESTRING(12.4 -45.3 35.3,45.4 41.6 12.3)")
68
68
  line_string = @factory.geometry
69
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
70
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3],[45.4,41.6,12.3]],256,true)
69
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
70
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3],[45.4,41.6,12.3]],256,true))
71
71
 
72
72
  @ewkt_parser.parse("SRID=256;LINESTRINGM(12.4 -45.3 35.3,45.4 41.6 12.3)")
73
73
  line_string = @factory.geometry
74
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
75
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3],[45.4,41.6,12.3]],256,false,true)
74
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
75
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3],[45.4,41.6,12.3]],256,false,true))
76
76
 
77
77
  @ewkt_parser.parse("SRID=256;LINESTRING(12.4 -45.3 35.3 25.2,45.4 41.6 12.3 13.75)")
78
78
  line_string = @factory.geometry
79
- line_string.should be_instance_of GeoRuby::SimpleFeatures::LineString
80
- line_string.should == GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3,25.2],[45.4,41.6,12.3,13.75]],256,true,true)
79
+ expect(line_string).to be_instance_of GeoRuby::SimpleFeatures::LineString
80
+ expect(line_string).to eq(GeoRuby::SimpleFeatures::LineString.from_coordinates([[12.4,-45.3,35.3,25.2],[45.4,41.6,12.3,13.75]],256,true,true))
81
81
  end
82
82
 
83
83
  it "test_polygon" do
84
84
  @ewkt_parser.parse("POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,3 1,3 3,1 3,1 1))")
85
85
  polygon = @factory.geometry
86
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
87
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)
86
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
87
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256))
88
88
 
89
89
  @ewkt_parser.parse("SRID=256;POLYGON( ( 0 0 2,4 0 2,4 4 2,0 4 2,0 0 2),(1 1 2,3 1 2,3 3 2,1 3 2,1 1 2))")
90
90
  polygon = @factory.geometry
91
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
92
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,true)
91
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
92
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,true))
93
93
 
94
94
  @ewkt_parser.parse("SRID=256;POLYGONM((0 0 2,4 0 2,4 4 2,0 4 2,0 0 2),(1 1 2,3 1 2,3 3 2,1 3 2,1 1 2))")
95
95
  polygon = @factory.geometry
96
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
97
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,false,true)
96
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
97
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2],[4,0,2],[4,4,2],[0,4,2],[0,0,2]],[[1,1,2],[3,1,2],[3,3,2],[1,3,2],[1,1,2]]],256,false,true))
98
98
 
99
99
  @ewkt_parser.parse("SRID=256;POLYGON((0 0 2 -45.1,4 0 2 5,4 4 2 4.67,0 4 2 1.34,0 0 2 -45.1),(1 1 2 12.3,3 1 2 123,3 3 2 12.2,1 3 2 12,1 1 2 12.3))")
100
100
  polygon = @factory.geometry
101
- polygon.should be_instance_of GeoRuby::SimpleFeatures::Polygon
102
- polygon.should == GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2,-45.1],[4,0,2,5],[4,4,2,4.67],[0,4,2,1.34],[0,0,2,-45.1]],[[1,1,2,12.3],[3,1,2,123],[3,3,2,12.2],[1,3,2,12],[1,1,2,12.3]]],256,true,true)
101
+ expect(polygon).to be_instance_of GeoRuby::SimpleFeatures::Polygon
102
+ expect(polygon).to eq(GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,2,-45.1],[4,0,2,5],[4,4,2,4.67],[0,4,2,1.34],[0,0,2,-45.1]],[[1,1,2,12.3],[3,1,2,123],[3,3,2,12.2],[1,3,2,12],[1,1,2,12.3]]],256,true,true))
103
103
  end
104
104
 
105
105
  it "test_multi_point" do
106
106
  #Form output by the current version of PostGIS. Future versions will output the one in the specification
107
107
  @ewkt_parser.parse("SRID=444;MULTIPOINT(12.4 -123.3,-65.1 123.4,123.55555555 123)")
108
108
  multi_point = @factory.geometry
109
- multi_point.should be_instance_of GeoRuby::SimpleFeatures::MultiPoint
110
- multi_point.should == GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444)
111
- multi_point.srid.should eql(444)
112
- multi_point[0].srid.should eql(444)
109
+ expect(multi_point).to be_instance_of GeoRuby::SimpleFeatures::MultiPoint
110
+ expect(multi_point).to eq(GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]],444))
111
+ expect(multi_point.srid).to eql(444)
112
+ expect(multi_point[0].srid).to eql(444)
113
113
 
114
114
  @ewkt_parser.parse("SRID=444;MULTIPOINT(12.4 -123.3 4.5,-65.1 123.4 6.7,123.55555555 123 7.8)")
115
115
  multi_point = @factory.geometry
116
- multi_point.should be_instance_of GeoRuby::SimpleFeatures::MultiPoint
117
- multi_point.should == GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,6.7],[123.55555555,123,7.8]],444,true)
118
- multi_point.srid.should eql(444)
119
- multi_point[0].srid.should eql(444)
116
+ expect(multi_point).to be_instance_of GeoRuby::SimpleFeatures::MultiPoint
117
+ expect(multi_point).to eq(GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,6.7],[123.55555555,123,7.8]],444,true))
118
+ expect(multi_point.srid).to eql(444)
119
+ expect(multi_point[0].srid).to eql(444)
120
120
 
121
121
  #Form in the EWKT specification (from the OGC)
122
122
  @ewkt_parser.parse("SRID=444;MULTIPOINT( ( 12.4 -123.3 4.5 ) , (-65.1 123.4 6.7),(123.55555555 123 7.8))")
123
123
  multi_point = @factory.geometry
124
- multi_point.should be_instance_of GeoRuby::SimpleFeatures::MultiPoint
125
- multi_point.should == GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,6.7],[123.55555555,123,7.8]],444,true)
126
- multi_point.srid.should eql(444)
127
- multi_point[0].srid.should eql(444)
124
+ expect(multi_point).to be_instance_of GeoRuby::SimpleFeatures::MultiPoint
125
+ expect(multi_point).to eq(GeoRuby::SimpleFeatures::MultiPoint.from_coordinates([[12.4,-123.3,4.5],[-65.1,123.4,6.7],[123.55555555,123,7.8]],444,true))
126
+ expect(multi_point.srid).to eql(444)
127
+ expect(multi_point[0].srid).to eql(444)
128
128
  end
129
129
 
130
130
  it "test_multi_line_string" do
131
131
  @ewkt_parser.parse("SRID=256;MULTILINESTRING((1.5 45.2,-54.12312 -0.012),(1.5 45.2,-54.12312 -0.012,45.123 123.3))")
132
132
  multi_line_string = @factory.geometry
133
- multi_line_string.should be_instance_of GeoRuby::SimpleFeatures::MultiLineString
134
- multi_line_string.should == GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012]],256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012],[45.123,123.3]],256)],256)
135
- multi_line_string.srid.should eql(256)
136
- multi_line_string[0].srid.should eql(256)
133
+ expect(multi_line_string).to be_instance_of GeoRuby::SimpleFeatures::MultiLineString
134
+ expect(multi_line_string).to eq(GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012]],256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2],[-54.12312,-0.012],[45.123,123.3]],256)],256))
135
+ expect(multi_line_string.srid).to eql(256)
136
+ expect(multi_line_string[0].srid).to eql(256)
137
137
 
138
138
  @ewkt_parser.parse("SRID=256;MULTILINESTRING((1.5 45.2 1.3 1.2,-54.12312 -0.012 1.2 4.5),(1.5 45.2 5.1 -4.5,-54.12312 -0.012 -6.8 3.4,45.123 123.3 4.5 -5.3))")
139
139
  multi_line_string = @factory.geometry
140
- multi_line_string.should be_instance_of GeoRuby::SimpleFeatures::MultiLineString
141
- multi_line_string.should == GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,1.3,1.2],[-54.12312,-0.012,1.2,4.5]],256,true,true),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,5.1,-4.5],[-54.12312,-0.012,-6.8,3.4],[45.123,123.3,4.5,-5.3]],256,true,true)],256,true,true)
142
- multi_line_string.srid.should eql(256)
143
- multi_line_string[0].srid.should eql(256)
140
+ expect(multi_line_string).to be_instance_of GeoRuby::SimpleFeatures::MultiLineString
141
+ expect(multi_line_string).to eq(GeoRuby::SimpleFeatures::MultiLineString.from_line_strings([GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,1.3,1.2],[-54.12312,-0.012,1.2,4.5]],256,true,true),GeoRuby::SimpleFeatures::LineString.from_coordinates([[1.5,45.2,5.1,-4.5],[-54.12312,-0.012,-6.8,3.4],[45.123,123.3,4.5,-5.3]],256,true,true)],256,true,true))
142
+ expect(multi_line_string.srid).to eql(256)
143
+ expect(multi_line_string[0].srid).to eql(256)
144
144
  end
145
145
 
146
146
  it "test_multi_polygon" do
147
147
  ewkt="SRID=256;MULTIPOLYGON(((12.4 -45.3,45.4 41.6,4.456 1.0698,12.4 -45.3),(2.4 5.3,5.4 1.4263,14.46 1.06,2.4 5.3)),((0.0 0.0,4.0 0.0,4.0 4.0,0.0 4.0,0.0 0.0),(1.0 1.0,3.0 1.0,3.0 3.0,1.0 3.0,1.0 1.0)))"
148
148
  @ewkt_parser.parse(ewkt)
149
149
  multi_polygon = @factory.geometry
150
- multi_polygon.should be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
151
- multi_polygon.should == GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3],[45.4,41.6],[4.456,1.0698],[12.4,-45.3]],[[2.4,5.3],[5.4,1.4263],[14.46,1.06],[2.4,5.3]]],256),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)],256)
152
- multi_polygon.srid.should eql(256)
153
- multi_polygon[0].srid.should eql(256)
154
- ewkt.should == multi_polygon.as_ewkt
150
+ expect(multi_polygon).to be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
151
+ expect(multi_polygon).to eq(GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3],[45.4,41.6],[4.456,1.0698],[12.4,-45.3]],[[2.4,5.3],[5.4,1.4263],[14.46,1.06],[2.4,5.3]]],256),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)],256))
152
+ expect(multi_polygon.srid).to eql(256)
153
+ expect(multi_polygon[0].srid).to eql(256)
154
+ expect(ewkt).to eq(multi_polygon.as_ewkt)
155
155
 
156
156
  ewkt="MULTIPOLYGON(((12.4 -45.3 2,45.4 41.6 3,4.456 1.0698 4,12.4 -45.3 2),(2.4 5.3 1,5.4 1.4263 3.44,14.46 1.06 4.5,2.4 5.3 1)),((0 0 5.6,4 0 5.4,4 4 1,0 4 23,0 0 5.6),(1 1 2.3,3 1 4,3 3 5,1 3 6,1 1 2.3)))"
157
157
  @ewkt_parser.parse(ewkt)
158
158
  multi_polygon = @factory.geometry
159
- multi_polygon.should be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
160
- multi_polygon.should == GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3,2],[45.4,41.6,3],[4.456,1.0698,4],[12.4,-45.3,2]],[[2.4,5.3,1],[5.4,1.4263,3.44],[14.46,1.06,4.5],[2.4,5.3,1]]],4326,true),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,5.6],[4,0,5.4],[4,4,1],[0,4,23],[0,0,5.6]],[[1,1,2.3],[3,1,4],[3,3,5],[1,3,6],[1,1,2.3]]],4326,true)],4326,true)
161
- multi_polygon.srid.should eql(4326)
162
- multi_polygon[0].srid.should eql(4326)
159
+ expect(multi_polygon).to be_instance_of GeoRuby::SimpleFeatures::MultiPolygon
160
+ expect(multi_polygon).to eq(GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[12.4,-45.3,2],[45.4,41.6,3],[4.456,1.0698,4],[12.4,-45.3,2]],[[2.4,5.3,1],[5.4,1.4263,3.44],[14.46,1.06,4.5],[2.4,5.3,1]]],4326,true),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0,5.6],[4,0,5.4],[4,4,1],[0,4,23],[0,0,5.6]],[[1,1,2.3],[3,1,4],[3,3,5],[1,3,6],[1,1,2.3]]],4326,true)],4326,true))
161
+ expect(multi_polygon.srid).to eql(4326)
162
+ expect(multi_polygon[0].srid).to eql(4326)
163
163
  end
164
164
 
165
165
  it "test_geometry_collection" do
166
166
  @ewkt_parser.parse("SRID=256;GEOMETRYCOLLECTION(POINT(4.67 45.4),LINESTRING(5.7 12.45,67.55 54),POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,3 1,3 3,1 3,1 1)))")
167
167
  geometry_collection = @factory.geometry
168
- geometry_collection.should be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
169
- geometry_collection.should == GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y(4.67,45.4,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45],[67.55,54]],256),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)],256)
170
- geometry_collection[0].srid.should eql(256)
168
+ expect(geometry_collection).to be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
169
+ expect(geometry_collection).to eq(GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y(4.67,45.4,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45],[67.55,54]],256),GeoRuby::SimpleFeatures::Polygon.from_coordinates([[[0,0],[4,0],[4,4],[0,4],[0,0]],[[1,1],[3,1],[3,3],[1,3],[1,1]]],256)],256))
170
+ expect(geometry_collection[0].srid).to eql(256)
171
171
 
172
172
  @ewkt_parser.parse("SRID=256;GEOMETRYCOLLECTIONM(POINTM(4.67 45.4 45.6),LINESTRINGM(5.7 12.45 5.6,67.55 54 6.7))")
173
173
  geometry_collection = @factory.geometry
174
- geometry_collection.should be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
175
- geometry_collection.should == GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y_m(4.67,45.4,45.6,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45,5.6],[67.55,54,6.7]],256,false,true)],256,false,true)
176
- geometry_collection[0].srid.should eql(256)
174
+ expect(geometry_collection).to be_instance_of GeoRuby::SimpleFeatures::GeometryCollection
175
+ expect(geometry_collection).to eq(GeoRuby::SimpleFeatures::GeometryCollection.from_geometries([GeoRuby::SimpleFeatures::Point.from_x_y_m(4.67,45.4,45.6,256),GeoRuby::SimpleFeatures::LineString.from_coordinates([[5.7,12.45,5.6],[67.55,54,6.7]],256,false,true)],256,false,true))
176
+ expect(geometry_collection[0].srid).to eql(256)
177
177
  end
178
178
 
179
179
  end