summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/feature_index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/geometry/feature_index.cpp')
-rw-r--r--src/mbgl/geometry/feature_index.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mbgl/geometry/feature_index.cpp b/src/mbgl/geometry/feature_index.cpp
index e7759b0868..520fd313a2 100644
--- a/src/mbgl/geometry/feature_index.cpp
+++ b/src/mbgl/geometry/feature_index.cpp
@@ -28,8 +28,13 @@ void FeatureIndex::insert(const GeometryCollection& geometries,
const std::string& bucketName) {
for (const auto& ring : geometries) {
auto envelope = mapbox::geometry::envelope(ring);
- grid.insert(IndexedSubfeature(index, sourceLayerName, bucketName, sortIndex++),
- {convertPoint<float>(envelope.min), convertPoint<float>(envelope.max)});
+ if (envelope.min.x < util::EXTENT &&
+ envelope.min.y < util::EXTENT &&
+ envelope.max.x >= 0 &&
+ envelope.max.y >= 0) {
+ grid.insert(IndexedSubfeature(index, sourceLayerName, bucketName, sortIndex++),
+ {convertPoint<float>(envelope.min), convertPoint<float>(envelope.max)});
+ }
}
}
@@ -106,7 +111,8 @@ std::unordered_map<std::string, std::vector<Feature>> FeatureIndex::lookupSymbol
});
for (const auto& symbolFeature : sortedFeatures) {
- addFeature(result, symbolFeature, queryOptions, tileID.canonical, layers, GeometryCoordinates(), {}, 0, {});
+ mat4 unusedMatrix;
+ addFeature(result, symbolFeature, queryOptions, tileID.canonical, layers, GeometryCoordinates(), {}, 0, unusedMatrix);
}
return result;
}