geojson parser : only close path if we have at least 3 vertices

This commit is contained in:
artemp 2013-11-20 15:12:11 +00:00
parent a6a4448e3d
commit 5eb406c7df

View file

@ -58,7 +58,10 @@ struct close_path
result_type operator() (T path) const result_type operator() (T path) const
{ {
BOOST_ASSERT( path!=0 ); 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();
}
} }
}; };