forked from organicmaps/organicmaps
Added max points limit in one coastline piece (10000) to avoid infinite indexing
This commit is contained in:
parent
58b0bd4baf
commit
02be5af144
1 changed files with 8 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
//#include "../base/logging.hpp"
|
||||
|
||||
#define MAX_MERGED_POINTS_COUNT 10000
|
||||
|
||||
FeatureBuilder1Merger::FeatureBuilder1Merger(FeatureBuilder1 const & fb)
|
||||
: FeatureBuilder1(fb)
|
||||
{
|
||||
|
@ -17,6 +19,12 @@ bool FeatureBuilder1Merger::MergeWith(FeatureBuilder1 const & fb)
|
|||
if (fb.m_Types != m_Types)
|
||||
return false;
|
||||
|
||||
// do not create too long features
|
||||
if (m_Geometry.size() > MAX_MERGED_POINTS_COUNT)
|
||||
return false;
|
||||
if (fb.m_Geometry.size() > MAX_MERGED_POINTS_COUNT)
|
||||
return false;
|
||||
|
||||
// check last-first points equality
|
||||
//if (m2::AlmostEqual(m_Geometry.back(), fb.m_Geometry.front()))
|
||||
if (m_Geometry.back() == fb.m_Geometry.front())
|
||||
|
|
Loading…
Add table
Reference in a new issue