Compare commits

...

2 Commits

Author SHA1 Message Date
Konstantin Pastbin
5a7c466483 [generator] Reduce coastlines detalisation on World map z6-9
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-09-04 18:26:17 +07:00
Konstantin Pastbin
0176b63ae3 [generator] Reduce glaciers and deserts detalisation on World map
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-09-04 18:23:06 +07:00
2 changed files with 13 additions and 4 deletions

View File

@@ -11,6 +11,7 @@
#include "routing/routing_helpers.hpp"
#include "indexer/classificator.hpp"
#include "indexer/dat_section_header.hpp"
#include "indexer/feature_impl.hpp"
#include "indexer/scales.hpp"
@@ -157,6 +158,11 @@ public:
Polygons const & polys = fb.GetGeometry();
bool const isCoast = fb.IsCoastCell();
static uint32_t const desertType = classif().GetTypeByPath({"natural", "desert"});
static uint32_t const glacierType = classif().GetTypeByPath({"natural", "glacier"});
// Reduce detalisation of glaciers and deserts on World map.
bool const isLowDetail = !IsCountry() && isArea && (fb.HasType(desertType, 2) || fb.HasType(glacierType, 2));
int const scalesStart = static_cast<int>(m_header.GetScalesCount()) - 1;
for (int i = scalesStart; i >= 0; --i)
{
@@ -167,15 +173,17 @@ public:
scales::PatchMaxDrawableScale(level)))
{
// Increment zoom level for coastline polygons (check and simplification)
// for better visual quality in the first geometry batch or whole WorldCoasts.
// to workaround visual artifacts on low zooms https://github.com/organicmaps/organicmaps/issues/2429
/// @todo Probably, better to keep 3 zooms (skip trg0 with fallback to trg1)?
if (isCoast)
if (isCoast && (level <= 1))
{
if (level <= scales::GetUpperWorldScale())
++level;
// Effectively change simplification zooms to {5, 6, 7, 8} from {3, 5, 7, 9}
++level;
if (i == 0)
++level;
}
if (isLowDetail && (level <= scales::GetUpperWorldScale()))
--level;
// Simplify and serialize geometry.
// The same line simplification algo is used both for lines

View File

@@ -176,6 +176,7 @@ public:
case feature::GeomType::Area:
{
/// @todo Initial area threshold to push area objects into World.mwm
/// @todo(pastk) Apply an older lower detail threshold of 0.01 to glaciers, deserts and coastlines (islets)
auto const & geometry = fb.GetOuterGeometry();
if (GetPolygonArea(geometry.begin(), geometry.end()) < 0.0025)
return false;