mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Use the point label as additional source for the id hash
Some (marine) maps have different points with the same type on the same position.
This commit is contained in:
parent
682fcc09cc
commit
bb22ad95b7
@ -14,9 +14,9 @@ using namespace IMG;
|
|||||||
|
|
||||||
#define MASK(bits) ((1U << (bits)) - 1U)
|
#define MASK(bits) ((1U << (bits)) - 1U)
|
||||||
|
|
||||||
static quint64 pointId(const QPoint &pos, quint32 type)
|
static quint64 pointId(const QPoint &pos, quint32 type, const QString &label)
|
||||||
{
|
{
|
||||||
quint64 hash = qHash(pos);
|
quint64 hash = qHash(pos) ^ qHash(label);
|
||||||
quint64 id = ((quint64)type)<<40 | (hash & 0xFFFFFFFFFF);
|
quint64 id = ((quint64)type)<<40 | (hash & 0xFFFFFFFFFF);
|
||||||
|
|
||||||
// Increase rendering priorities for some special items
|
// Increase rendering priorities for some special items
|
||||||
@ -483,11 +483,11 @@ bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv,
|
|||||||
|
|
||||||
point.type = (quint16)type<<8 | subtype;
|
point.type = (quint16)type<<8 | subtype;
|
||||||
point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y()));
|
point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y()));
|
||||||
point.id = pointId(pos, point.type);
|
|
||||||
if (lbl && (labelPtr & 0x3FFFFF))
|
if (lbl && (labelPtr & 0x3FFFFF))
|
||||||
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF,
|
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF,
|
||||||
labelPtr & 0x400000, !(Style::isCountry(point.type)
|
labelPtr & 0x400000, !(Style::isCountry(point.type)
|
||||||
|| Style::isState(point.type)), Style::isSpot(point.type));
|
|| Style::isState(point.type)), Style::isSpot(point.type));
|
||||||
|
point.id = pointId(pos, point.type, point.label.text());
|
||||||
|
|
||||||
points->append(point);
|
points->append(point);
|
||||||
}
|
}
|
||||||
@ -536,9 +536,9 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
point.coordinates = Coordinates(toWGS24(p.x()), toWGS24(p.y()));
|
point.coordinates = Coordinates(toWGS24(p.x()), toWGS24(p.y()));
|
||||||
point.id = pointId(p, point.type);
|
|
||||||
if (lbl && (labelPtr & 0x3FFFFF))
|
if (lbl && (labelPtr & 0x3FFFFF))
|
||||||
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF);
|
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF);
|
||||||
|
point.id = pointId(p, point.type, point.label.text());
|
||||||
|
|
||||||
points->append(point);
|
points->append(point);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user