Repository navigation
CollisionTile::queryRenderedSymbols should receive the query geometry - #6627
brunoabinader merged 5 commits into
Conversation
|
@brunoabinader, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfirebaugh, @ansis and @kkaefer to be potential reviewers. |
| std::unordered_map<std::string, std::unordered_set<std::size_t>> sourceLayerFeatures; | ||
|
|
||
| auto anchor = util::matrixMultiply(rotationMatrix, convertPoint<float>(box.min)); | ||
| mapbox::geometry::box<float> box { |
There was a problem hiding this comment.
This would be more clearly expressed as a rotating transform (using a for loop, std::transform, or a geometry.hpp specific version) followed by mapbox::geometry::envelope.
There was a problem hiding this comment.
Intuit was to avoid traversing through the geometries twice - first for transforming each point, and then later for obtaining the bounding box. However, I acknowledge the need for readability in complex code like this, so doing as suggested.
| } | ||
|
|
||
| std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const mapbox::geometry::box<int16_t>& box, const float scale) { | ||
| std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const GeometryCollection& queryGeometry, const float scale) { |
There was a problem hiding this comment.
I think we can simplify the parameter here, and various other places, to const GeometryCoordinates& queryGeometry. There's no need to support multipolygon query geometries: d7a816d.
There was a problem hiding this comment.
I perceived this too, though didn't wanted to change behavior - good to know 👍
cc1192a to
5f524bc
Compare
|
Addressed @jfirebaugh review comments. |
jfirebaugh
left a comment
There was a problem hiding this comment.
Code looks good; CI failures need investigation of course.
83d8653 to
c956030
Compare
This provides a means of testing cases where an updated geometry tile would return wrong results for `queryRenderedFeatures`.
This gives the ability to pan and/or rotate the map in a posterior step after initial render for testing purposes.
c956030 to
7dbc302
Compare
|
Render test failures were caused by rebasing the newly-added query tests |

As per @ansis comments in #6055: