@@ -22,16 +22,16 @@ public function it_stores_geometry_collection(): void
22
22
'geometry_collection ' => new GeometryCollection ([
23
23
new Polygon ([
24
24
new LineString ([
25
- new Point (0 , 0 ),
26
- new Point (1 , 1 ),
27
- new Point (2 , 2 ),
28
- new Point (3 , 3 ),
29
- new Point (0 , 0 ),
25
+ new Point (180 , 0 ),
26
+ new Point (179 , 1 ),
27
+ new Point (178 , 2 ),
28
+ new Point (177 , 3 ),
29
+ new Point (180 , 0 ),
30
30
]),
31
31
]),
32
- new Point (0 , 0 ),
32
+ new Point (180 , 0 ),
33
33
]),
34
- ])-> fresh () ;
34
+ ]);
35
35
36
36
$ this ->assertTrue ($ testPlace ->geometry_collection instanceof GeometryCollection);
37
37
@@ -41,21 +41,21 @@ public function it_stores_geometry_collection(): void
41
41
$ lineStrings = $ polygon ->getGeometries ();
42
42
$ points = $ lineStrings [0 ]->getGeometries ();
43
43
44
- $ this ->assertEquals (0 , $ points [0 ]->latitude );
44
+ $ this ->assertEquals (180 , $ points [0 ]->latitude );
45
45
$ this ->assertEquals (0 , $ points [0 ]->longitude );
46
- $ this ->assertEquals (1 , $ points [1 ]->latitude );
46
+ $ this ->assertEquals (179 , $ points [1 ]->latitude );
47
47
$ this ->assertEquals (1 , $ points [1 ]->longitude );
48
- $ this ->assertEquals (2 , $ points [2 ]->latitude );
48
+ $ this ->assertEquals (178 , $ points [2 ]->latitude );
49
49
$ this ->assertEquals (2 , $ points [2 ]->longitude );
50
- $ this ->assertEquals (3 , $ points [3 ]->latitude );
50
+ $ this ->assertEquals (177 , $ points [3 ]->latitude );
51
51
$ this ->assertEquals (3 , $ points [3 ]->longitude );
52
- $ this ->assertEquals (0 , $ points [4 ]->latitude );
52
+ $ this ->assertEquals (180 , $ points [4 ]->latitude );
53
53
$ this ->assertEquals (0 , $ points [4 ]->longitude );
54
54
55
55
/** @var Point $point */
56
56
$ point = $ geometries [1 ];
57
57
58
- $ this ->assertEquals (0 , $ point ->latitude );
58
+ $ this ->assertEquals (180 , $ point ->latitude );
59
59
$ this ->assertEquals (0 , $ point ->longitude );
60
60
61
61
$ this ->assertDatabaseCount ($ testPlace ->getTable (), 1 );
@@ -66,8 +66,8 @@ public function it_stores_geometry_collection_from_geo_json(): void
66
66
{
67
67
/** @var TestPlace $testPlace */
68
68
$ testPlace = TestPlace::factory ()->create ([
69
- 'geometry_collection ' => GeometryCollection::fromJson ('{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[0,0 ],[1,1 ],[2,2 ],[3,3 ],[0,0 ]]]},{"type":"Point","coordinates":[0,0 ]}]} ' ),
70
- ])-> fresh () ;
69
+ 'geometry_collection ' => GeometryCollection::fromJson ('{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[0,180 ],[1,179 ],[2,178 ],[3,177 ],[0,180 ]]]},{"type":"Point","coordinates":[0,180 ]}]} ' ),
70
+ ]);
71
71
72
72
$ this ->assertTrue ($ testPlace ->geometry_collection instanceof GeometryCollection);
73
73
@@ -77,21 +77,21 @@ public function it_stores_geometry_collection_from_geo_json(): void
77
77
$ lineStrings = $ polygon ->getGeometries ();
78
78
$ points = $ lineStrings [0 ]->getGeometries ();
79
79
80
- $ this ->assertEquals (0 , $ points [0 ]->latitude );
80
+ $ this ->assertEquals (180 , $ points [0 ]->latitude );
81
81
$ this ->assertEquals (0 , $ points [0 ]->longitude );
82
- $ this ->assertEquals (1 , $ points [1 ]->latitude );
82
+ $ this ->assertEquals (179 , $ points [1 ]->latitude );
83
83
$ this ->assertEquals (1 , $ points [1 ]->longitude );
84
- $ this ->assertEquals (2 , $ points [2 ]->latitude );
84
+ $ this ->assertEquals (178 , $ points [2 ]->latitude );
85
85
$ this ->assertEquals (2 , $ points [2 ]->longitude );
86
- $ this ->assertEquals (3 , $ points [3 ]->latitude );
86
+ $ this ->assertEquals (177 , $ points [3 ]->latitude );
87
87
$ this ->assertEquals (3 , $ points [3 ]->longitude );
88
- $ this ->assertEquals (0 , $ points [4 ]->latitude );
88
+ $ this ->assertEquals (180 , $ points [4 ]->latitude );
89
89
$ this ->assertEquals (0 , $ points [4 ]->longitude );
90
90
91
91
/** @var Point $point */
92
92
$ point = $ geometries [1 ];
93
93
94
- $ this ->assertEquals (0 , $ point ->latitude );
94
+ $ this ->assertEquals (180 , $ point ->latitude );
95
95
$ this ->assertEquals (0 , $ point ->longitude );
96
96
97
97
$ this ->assertDatabaseCount ($ testPlace ->getTable (), 1 );
@@ -102,8 +102,8 @@ public function it_stores_geometry_collection_from_feature_collection_geo_json()
102
102
{
103
103
/** @var TestPlace $testPlace */
104
104
$ testPlace = TestPlace::factory ()->create ([
105
- 'geometry_collection ' => GeometryCollection::fromJson ('{"type":"FeatureCollection","features":[{"type":"Feature","properties":[],"geometry":{"type":"Polygon","coordinates":[[[0,0 ],[1,1 ],[2,2 ],[3,3 ],[0,0 ]]]}},{"type":"Feature","properties":[],"geometry":{"type":"Point","coordinates":[0,0 ]}}]} ' ),
106
- ])-> fresh () ;
105
+ 'geometry_collection ' => GeometryCollection::fromJson ('{"type":"FeatureCollection","features":[{"type":"Feature","properties":[],"geometry":{"type":"Polygon","coordinates":[[[0,180 ],[1,179 ],[2,178 ],[3,177 ],[0,180 ]]]}},{"type":"Feature","properties":[],"geometry":{"type":"Point","coordinates":[0,180 ]}}]} ' ),
106
+ ]);
107
107
108
108
$ this ->assertTrue ($ testPlace ->geometry_collection instanceof GeometryCollection);
109
109
@@ -113,21 +113,21 @@ public function it_stores_geometry_collection_from_feature_collection_geo_json()
113
113
$ lineStrings = $ polygon ->getGeometries ();
114
114
$ points = $ lineStrings [0 ]->getGeometries ();
115
115
116
- $ this ->assertEquals (0 , $ points [0 ]->latitude );
116
+ $ this ->assertEquals (180 , $ points [0 ]->latitude );
117
117
$ this ->assertEquals (0 , $ points [0 ]->longitude );
118
- $ this ->assertEquals (1 , $ points [1 ]->latitude );
118
+ $ this ->assertEquals (179 , $ points [1 ]->latitude );
119
119
$ this ->assertEquals (1 , $ points [1 ]->longitude );
120
- $ this ->assertEquals (2 , $ points [2 ]->latitude );
120
+ $ this ->assertEquals (178 , $ points [2 ]->latitude );
121
121
$ this ->assertEquals (2 , $ points [2 ]->longitude );
122
- $ this ->assertEquals (3 , $ points [3 ]->latitude );
122
+ $ this ->assertEquals (177 , $ points [3 ]->latitude );
123
123
$ this ->assertEquals (3 , $ points [3 ]->longitude );
124
- $ this ->assertEquals (0 , $ points [4 ]->latitude );
124
+ $ this ->assertEquals (180 , $ points [4 ]->latitude );
125
125
$ this ->assertEquals (0 , $ points [4 ]->longitude );
126
126
127
127
/** @var Point $point */
128
128
$ point = $ geometries [1 ];
129
129
130
- $ this ->assertEquals (0 , $ point ->latitude );
130
+ $ this ->assertEquals (180 , $ point ->latitude );
131
131
$ this ->assertEquals (0 , $ point ->longitude );
132
132
133
133
$ this ->assertDatabaseCount ($ testPlace ->getTable (), 1 );
@@ -139,18 +139,18 @@ public function it_generates_geometry_collection_geo_json(): void
139
139
$ geometryCollection = new GeometryCollection ([
140
140
new Polygon ([
141
141
new LineString ([
142
- new Point (0 , 0 ),
143
- new Point (1 , 1 ),
144
- new Point (2 , 2 ),
145
- new Point (3 , 3 ),
146
- new Point (0 , 0 ),
142
+ new Point (180 , 0 ),
143
+ new Point (179 , 1 ),
144
+ new Point (178 , 2 ),
145
+ new Point (177 , 3 ),
146
+ new Point (180 , 0 ),
147
147
]),
148
148
]),
149
- new Point (0 , 0 ),
149
+ new Point (180 , 0 ),
150
150
]);
151
151
152
152
$ this ->assertEquals (
153
- '{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[0,0 ],[1,1 ],[2,2 ],[3,3 ],[0,0 ]]]},{"type":"Point","coordinates":[0,0 ]}]} ' ,
153
+ '{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[0,180 ],[1,179 ],[2,178 ],[3,177 ],[0,180 ]]]},{"type":"Point","coordinates":[0,180 ]}]} ' ,
154
154
$ geometryCollection ->toJson ()
155
155
);
156
156
}
@@ -161,18 +161,18 @@ public function it_generates_geometry_collection_feature_collection_json(): void
161
161
$ geometryCollection = new GeometryCollection ([
162
162
new Polygon ([
163
163
new LineString ([
164
- new Point (0 , 0 ),
165
- new Point (1 , 1 ),
166
- new Point (2 , 2 ),
167
- new Point (3 , 3 ),
168
- new Point (0 , 0 ),
164
+ new Point (180 , 0 ),
165
+ new Point (179 , 1 ),
166
+ new Point (178 , 2 ),
167
+ new Point (177 , 3 ),
168
+ new Point (180 , 0 ),
169
169
]),
170
170
]),
171
- new Point (0 , 0 ),
171
+ new Point (180 , 0 ),
172
172
]);
173
173
174
174
$ this ->assertEquals (
175
- '{"type":"FeatureCollection","features":[{"type":"Feature","properties":[],"geometry":{"type":"Polygon","coordinates":[[[0,0 ],[1,1 ],[2,2 ],[3,3 ],[0,0 ]]]}},{"type":"Feature","properties":[],"geometry":{"type":"Point","coordinates":[0,0 ]}}]} ' ,
175
+ '{"type":"FeatureCollection","features":[{"type":"Feature","properties":[],"geometry":{"type":"Polygon","coordinates":[[[0,180 ],[1,179 ],[2,178 ],[3,177 ],[0,180 ]]]}},{"type":"Feature","properties":[],"geometry":{"type":"Point","coordinates":[0,180 ]}}]} ' ,
176
176
$ geometryCollection ->toFeatureCollectionJson ()
177
177
);
178
178
}
0 commit comments