getOrderedOuterWays() as $way) { foreach ($way->points as $point) { $positions[] = new \GeoJson\Geometry\Point([ $point->longitude, $point->latitude ]); } } return new \GeoJson\Geometry\Polygon([ $positions ]); } }