mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Compare commits
2 Commits
v2025.10.0
...
pastk-mapg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a7c466483 | ||
|
|
0176b63ae3 |
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user