From 70e8e3d6b957ba17c9bc818cf41945c4884ab772 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Wed, 22 Jun 2022 20:02:43 +0100 Subject: [PATCH] Don't close GPX polylines --- lib/geo_ruby/gpx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/geo_ruby/gpx.rb b/lib/geo_ruby/gpx.rb index 10a1a26..71649b1 100644 --- a/lib/geo_ruby/gpx.rb +++ b/lib/geo_ruby/gpx.rb @@ -73,7 +73,7 @@ def as_line_string # If the GPX isn't closed, a line from the first # to the last point will be created to close it. def as_polygon - GeoRuby::SimpleFeatures::Polygon.from_points([@points[0] == @points[-1] ? @points : @points.push(@points[0].clone)]) + GeoRuby::SimpleFeatures::Polygon.from_points([@points[0] == @points[-1] ? @points : (@points + [@points[0]])]) end # Return GPX Envelope