forked from organicmaps/organicmaps
Minor feature generation fixes.
This commit is contained in:
parent
f5733b6729
commit
501617ecc7
4 changed files with 8 additions and 3 deletions
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "../geometry/region2d/binary_operators.hpp"
|
||||
|
||||
#include "../base/string_utils.hpp"
|
||||
|
||||
#include "../std/bind.hpp"
|
||||
|
||||
|
||||
|
@ -167,6 +169,10 @@ bool CoastlineFeaturesGenerator::GetFeature(size_t i, FeatureBuilder1 & fb)
|
|||
m_tree.ForEachInRect(GetLimitRect(rectR), bind<void>(ref(doDiff), _1));
|
||||
|
||||
// assign feature
|
||||
FeatureParams params;
|
||||
params.name.AddString(0, strings::to_string(i));
|
||||
fb.SetParams(params);
|
||||
|
||||
doDiff.AssignGeometry(fb);
|
||||
fb.SetArea();
|
||||
fb.AddType(m_coastType);
|
||||
|
|
|
@ -201,9 +201,8 @@ bool FeatureBuilder1::CheckValid() const
|
|||
|
||||
if (type == GEOM_AREA)
|
||||
{
|
||||
// Use '4' because the first point should be equal with the last one
|
||||
for (list<points_t>::const_iterator i = m_Polygons.begin(); i != m_Polygons.end(); ++i)
|
||||
CHECK(i->size() >= 4, ());
|
||||
CHECK(i->size() >= 3, ());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -83,6 +83,7 @@ public:
|
|||
|
||||
bool PreSerialize();
|
||||
|
||||
/// Note! This function overrides all previous assigned types.
|
||||
inline void SetParams(FeatureParams const & params) { m_Params = params; }
|
||||
|
||||
/// For OSM debugging, store original OSM id
|
||||
|
|
|
@ -436,7 +436,6 @@ namespace feature
|
|||
|
||||
FeaturesCollector2 collector(datFilePath, header);
|
||||
|
||||
FeatureBuilder1::buffer_t buffer;
|
||||
for (size_t i = 0; i < midPoints.m_vec.size(); ++i)
|
||||
{
|
||||
ReaderSource<FileReader> src(reader);
|
||||
|
|
Loading…
Add table
Reference in a new issue