Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generator/feature_generator.cpp3
-rw-r--r--generator/feature_generator.hpp2
-rw-r--r--generator/feature_sorter.cpp51
-rw-r--r--generator/feature_sorter.hpp4
-rw-r--r--geometry/distance.hpp2
5 files changed, 8 insertions, 54 deletions
diff --git a/generator/feature_generator.cpp b/generator/feature_generator.cpp
index a941cbfd45..af4b1379d5 100644
--- a/generator/feature_generator.cpp
+++ b/generator/feature_generator.cpp
@@ -271,7 +271,8 @@ public:
if (info.m_createWorld)
{
m_world.reset(new WorldMapGenerator<FeaturesCollector>(info));
- m_coasts.reset(new CoastlineFeaturesGenerator(m_coastType, g_coastsCellLevel));
+ // 6 - is cell level for oceans covering
+ m_coasts.reset(new CoastlineFeaturesGenerator(m_coastType, 6));
m_coastsHolder.reset(new FeaturesCollector(
info.m_datFilePrefix + WORLD_COASTS_FILE_NAME + info.m_datFileSuffix));
}
diff --git a/generator/feature_generator.hpp b/generator/feature_generator.hpp
index cf0f052c13..40f94f1a64 100644
--- a/generator/feature_generator.hpp
+++ b/generator/feature_generator.hpp
@@ -34,6 +34,4 @@ namespace feature
void operator() (FeatureBuilder1 const & f);
};
-
- static const int g_coastsCellLevel = 7;
}
diff --git a/generator/feature_sorter.cpp b/generator/feature_sorter.cpp
index 29c49818d7..1714b5cb69 100644
--- a/generator/feature_sorter.cpp
+++ b/generator/feature_sorter.cpp
@@ -353,51 +353,16 @@ namespace feature
}
};
- /*
- class less_points
- {
- double const m_eps;
- public:
- less_points() : m_eps(1.0E-6) {}
-
- bool operator() (m2::PointD const & p1, m2::PointD const & p2) const
- {
- if (p1.x + m_eps < p2.x) return true;
- if (fabs(p1.x - p2.x) <= m_eps)
- return (p1.y + m_eps < p2.y);
- else return false;
- }
- };
-
- class equal_points
- {
- double const m_eps;
- public:
- equal_points() : m_eps(1.0E-6) {}
-
- bool operator() (m2::PointD const & p1, m2::PointD const & p2) const
- {
- return p1.EqualDxDy(p2, m_eps);
- }
- };
-
- typedef set<m2::PointD, less_points> points_set_t;
- */
-
class BoundsDistance : public mn::DistanceToLineSquare<m2::PointD>
{
double m_eps;
double m_minX, m_minY, m_maxX, m_maxY;
public:
- BoundsDistance(uint32_t cellID, int level)
+ BoundsDistance() : m_eps(MercatorBounds::GetCellID2PointAbsEpsilon())
{
- RectId const cell = RectId::FromBitsAndLevel(cellID, level);
- CellIdConverter<MercatorBounds, RectId>::GetCellBounds(cell, m_minX, m_minY, m_maxX, m_maxY);
}
- void SetEpsilon(double eps) { m_eps = eps; }
-
double operator() (m2::PointD const & p) const
{
if (fabs(p.x - m_minX) <= m_eps || fabs(p.x - m_maxX) <= m_eps ||
@@ -415,18 +380,12 @@ namespace feature
FeatureBuilder2 const & fb)
{
uint32_t cellID;
- if (fb.GetCoastCell(cellID))
+ if ((level >= scales::GetUpperWorldScale()) && fb.GetCoastCell(cellID))
{
- /*
- points_set_t toSkip;
- {
- points_t v(in);
- sort(v.begin(), v.end(), less_points());
- toSkip.insert(unique(v.begin(), v.end(), equal_points()), v.end());
- }
- */
+ // Note! Do such special simplification only for upper world level and countries levels.
+ // There is no need for this simplification in small world levels.
- BoundsDistance dist(cellID, g_coastsCellLevel);
+ BoundsDistance dist;
feature::SimplifyPoints(dist, in, out, level);
}
else
diff --git a/generator/feature_sorter.hpp b/generator/feature_sorter.hpp
index 279e1aedde..046552a321 100644
--- a/generator/feature_sorter.hpp
+++ b/generator/feature_sorter.hpp
@@ -30,10 +30,8 @@ namespace feature
{
if (in.size() >= 2)
{
- double eps = scales::GetEpsilonForSimplify(level);
- dist.SetEpsilon(eps);
+ double const eps = my::sq(scales::GetEpsilonForSimplify(level));
- eps = my::sq(eps);
SimplifyNearOptimal(20, in.begin(), in.end(), eps, dist,
AccumulateSkipSmallTrg<DistanceT, m2::PointD>(dist, out, eps));
diff --git a/geometry/distance.hpp b/geometry/distance.hpp
index b4097851c3..45efe20b97 100644
--- a/geometry/distance.hpp
+++ b/geometry/distance.hpp
@@ -17,8 +17,6 @@ private:
STATIC_ASSERT(numeric_limits<typename PointT::value_type>::is_signed);
public:
- void SetEpsilon(double) {}
-
void SetBounds(PointT const & p0, PointT const & p1)
{
m_P0 = p0;