funiq / geoPHP

Advanced geometry operations in PHP
https://geophp.net
Other
21 stars 21 forks source link

fix LinearRing on innerBoundaryIs for KML Adapter #11

Open nono303 opened 9 months ago

nono303 commented 9 months ago

Hi, According to https://developers.google.com/kml/documentation/kmlreference?hl=fr#innerboundaryis here is a quick fix for kml adapter

diff --git "a/src/Adapter/KML.php" "b/src/Adapter/KML.php"
index 4b0f959..28b6e84 100644
--- "a/src/Adapter/KML.php"
+++ "b/src/Adapter/KML.php"
@@ -344,7 +344,7 @@ class KML implements GeoAdapter
                 . '</' . $this->nss . 'outerBoundaryIs>';
             foreach (array_slice($components, 1) as $comp) {
                 $str .= '<' . $this->nss . 'innerBoundaryIs>'
-                    . $this->linestringToKML($comp)
+                    . $this->linestringToKML($comp, 'LinearRing')
                     . '</' . $this->nss . 'innerBoundaryIs>';
             }
         }
nono303 commented 3 weeks ago

fixed in my fork https://github.com/nono303/geoPHP/commit/a40b8054e4c24472c25b4a49937ef174faf69ce6