From 13f6880d17bd462af0c0e1bba8a5e16f181e7a0a Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 18 May 2016 01:23:58 +0200 Subject: [PATCH] Implement #127 --- src/Geometry/Collection.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Geometry/Collection.php b/src/Geometry/Collection.php index 9ce907ea..0e39aea5 100644 --- a/src/Geometry/Collection.php +++ b/src/Geometry/Collection.php @@ -222,7 +222,9 @@ public function numPoints() { public function getPoints() { $points = array(); foreach ($this->components as $component) { - $points = array_merge($points, $component->getPoints()); + foreach ($component->getPoints() as $point) { + $points[] = $point; + } } return $points; } @@ -274,7 +276,9 @@ public function isSimple() { public function explode() { $parts = array(); foreach ($this->components as $component) { - $parts = array_merge($parts, $component->explode()); + foreach ($component->explode() as $subComponent) { + $parts[] = $subComponent; + } } return $parts; }