From 5eb406c7df950acd4c4430c77899ea89390a2020 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 20 Nov 2013 15:12:11 +0000 Subject: [PATCH] geojson parser : only close path if we have at least 3 vertices --- include/mapnik/json/geometry_grammar.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/mapnik/json/geometry_grammar.hpp b/include/mapnik/json/geometry_grammar.hpp index 821ab9646..416442161 100644 --- a/include/mapnik/json/geometry_grammar.hpp +++ b/include/mapnik/json/geometry_grammar.hpp @@ -58,7 +58,10 @@ struct close_path result_type operator() (T path) const { BOOST_ASSERT( path!=0 ); - path->close_path(); + if (path->size() > 2u) // to form a polygon ring we need at least 3 vertices + { + path->close_path(); + } } };