@@ -123,7 +123,8 @@ public function testFromJsonMultiLineString()
123
123
$ this ->assertEquals (new Point (3 , 2 ), $ multiLineStringLineStrings [1 ][2 ]);
124
124
}
125
125
126
- public function testFromJsonMultiPolygon () {
126
+ public function testFromJsonMultiPolygon ()
127
+ {
127
128
$ multiPolygon = Geometry::fromJson ('{"type":"MultiPolygon","coordinates":[[[[1,1],[1,2],[2,2],[2,1],[1,1]]],[[[0,0],[0,1],[1,1],[1,0],[0,0]]]]} ' );
128
129
$ this ->assertInstanceOf (MultiPolygon::class, $ multiPolygon );
129
130
$ multiPolygonPolygons = $ multiPolygon ->getGeometries ();
@@ -133,25 +134,27 @@ public function testFromJsonMultiPolygon() {
133
134
new Point (2 , 1 ),
134
135
new Point (2 , 2 ),
135
136
new Point (1 , 2 ),
136
- new Point (1 , 1 )
137
+ new Point (1 , 1 ),
137
138
])]), $ multiPolygonPolygons [0 ]);
138
139
$ this ->assertEquals (new Polygon ([new LineString ([
139
140
new Point (0 , 0 ),
140
141
new Point (1 , 0 ),
141
142
new Point (1 , 1 ),
142
143
new Point (0 , 1 ),
143
- new Point (0 , 0 )
144
+ new Point (0 , 0 ),
144
145
])]), $ multiPolygonPolygons [1 ]);
145
146
}
146
147
147
- public function testFromJsonPointFeature () {
148
+ public function testFromJsonPointFeature ()
149
+ {
148
150
$ point = Geometry::fromJson ('{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[3.4,1.2]}} ' );
149
151
$ this ->assertInstanceOf (Point::class, $ point );
150
152
$ this ->assertEquals (1.2 , $ point ->getLat ());
151
153
$ this ->assertEquals (3.4 , $ point ->getLng ());
152
154
}
153
-
154
- public function testFromJsonMultiPointFeatureCollection () {
155
+
156
+ public function testFromJsonMultiPointFeatureCollection ()
157
+ {
155
158
$ geometryCollection = Geometry::fromJson ('{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[1,2]}},{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[3,4]}}]} ' );
156
159
$ this ->assertInstanceOf (GeometryCollection::class, $ geometryCollection );
157
160
$ geometryCollectionPoints = $ geometryCollection ->getGeometries ();
0 commit comments