summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2018-05-22 16:08:00 -0400
committerAnsis Brammanis <ansis@mapbox.com>2018-05-22 16:08:00 -0400
commit464d78db49cc95de78c666ca2fdf1f1bfcccb49b (patch)
tree3e24fd928c7fd56ea900b9f3bc29ed574b681141
parent8a02fa42ecfb959a8958ccf414b5b8564c6d4d85 (diff)
downloadqtlocation-mapboxgl-upstream/fix-11357.tar.gz
[core] fix deduping rings in querying, #11357upstream/fix-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 cc69a60ca0..521375807e 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)});
}
}