summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2018-05-22 16:08:00 -0400
committerChris Loer <chris.loer@mapbox.com>2019-01-04 15:00:19 -0800
commit750734df34fe4362c3037a809238997f317997cd (patch)
tree8349d9552682e904f885264c14fbe36c0e5d63d4
parent963dd5e567362b9bf9448d7d2da746d6892a91b2 (diff)
downloadqtlocation-mapboxgl-750734df34fe4362c3037a809238997f317997cd.tar.gz
[core] fix deduping rings in querying, #11357
-rw-r--r--src/mbgl/geometry/feature_index.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/geometry/feature_index.cpp b/src/mbgl/geometry/feature_index.cpp
index 7dc46c4dfc..ffb1d6e72d 100644
--- a/src/mbgl/geometry/feature_index.cpp
+++ b/src/mbgl/geometry/feature_index.cpp
@@ -25,13 +25,14 @@ void FeatureIndex::insert(const GeometryCollection& geometries,
std::size_t index,
const std::string& sourceLayerName,
const std::string& bucketLeaderID) {
+ auto featureSortIndex = sortIndex++;
for (const auto& ring : geometries) {
auto envelope = mapbox::geometry::envelope(ring);
if (envelope.min.x < util::EXTENT &&
envelope.min.y < util::EXTENT &&
envelope.max.x >= 0 &&
envelope.max.y >= 0) {
- grid.insert(IndexedSubfeature(index, sourceLayerName, bucketLeaderID, sortIndex++),
+ grid.insert(IndexedSubfeature(index, sourceLayerName, bucketLeaderID, featureSortIndex++),
{convertPoint<float>(envelope.min), convertPoint<float>(envelope.max)});
}
}