From 70f0e8982b597f2142f13c940e4743344875a563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 7 Feb 2022 00:59:38 +0100 Subject: [PATCH] Generate propper IDs for pints with class labels --- src/map/IMG/rgnfile.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index 42a0c423..bf5daa5e 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -18,7 +18,7 @@ static quint64 pointId(const QPoint &pos, quint32 type, quint32 labelPtr) quint64 id; uint hash = (uint)qHash(QPair((uint)qHash( - QPair(pos.x(), pos.y())), labelPtr & 0x3FFFFF)); + QPair(pos.x(), pos.y())), labelPtr)); id = ((quint64)type)<<32 | hash; // Make country labels precedent over city labels if (!Style::isCountry(type)) @@ -451,7 +451,7 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv, if (_pointsGblFlags && !skipGblFields(hdl, _pointsGblFlags)) return false; - QPoint pos(subdiv->lon() + LS(lon, 24-subdiv->bits()), + QPoint p(subdiv->lon() + LS(lon, 24-subdiv->bits()), subdiv->lat() + LS(lat, 24-subdiv->bits())); // Discard NT points breaking style draw order logic (and causing huge @@ -459,8 +459,9 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv, if (point.type == 0x11400) continue; - point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y())); - point.id = pointId(pos, point.type, labelPtr & 0x3FFFFF); + point.coordinates = Coordinates(toWGS24(p.x()), toWGS24(p.y())); + point.id = pointId(p, point.type, point.classLabel ? pos(hdl) + : labelPtr & 0x3FFFFF); if (lbl && (labelPtr & 0x3FFFFF)) point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF);