X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FPathController.php;h=af9d104fb2efb3bb5e78d9d3dfc0ef8492d11e12;hb=c06c7fd6e6f26d31abb8d7c9a9f9e3f2d5b27d5c;hp=394da6921cac13042844cc78e0a5e4d99a839041;hpb=e534c17db2f3986751f4a96900e4aaae56d34873;p=syj.git
diff --git a/application/controllers/PathController.php b/application/controllers/PathController.php
index 394da69..af9d104 100644
--- a/application/controllers/PathController.php
+++ b/application/controllers/PathController.php
@@ -77,6 +77,18 @@ class PathController extends Zend_Controller_Action
throw new Syj_Exception_InvalidGeomUpload();
}
+ // merge linestrings for gpx containting multiple trkseg elements.
+ if ($classname == 'gisconverter\\GPX' && $geom::name == 'GeometryCollection') {
+ $geomstring = "";
+ foreach (array_filter($geom->components, function ($geom) {
+ return $geom::name == "LineString";
+ }) as $linestring) {
+ $geomstring .= str_replace("", "",
+ str_replace("", "", $linestring->toGPX()));
+ }
+ $geom = $decoder->geomFromText("" . $geomstring . "");
+ }
+
if ($geom::name != "LineString") {
throw new Syj_Exception_InvalidGeomUpload();
}