geojson parser : only close path if we have at least 3 vertices
This commit is contained in:
parent
a6a4448e3d
commit
5eb406c7df
1 changed files with 4 additions and 1 deletions
|
@ -58,8 +58,11 @@ struct close_path
|
||||||
result_type operator() (T path) const
|
result_type operator() (T path) const
|
||||||
{
|
{
|
||||||
BOOST_ASSERT( path!=0 );
|
BOOST_ASSERT( path!=0 );
|
||||||
|
if (path->size() > 2u) // to form a polygon ring we need at least 3 vertices
|
||||||
|
{
|
||||||
path->close_path();
|
path->close_path();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cleanup
|
struct cleanup
|
||||||
|
|
Loading…
Reference in a new issue