-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid clipping overhead when geometry is fully within clipping box #126
Comments
I am worried about the added cost of checking a bounding box prior to clipping being an added time for situations where data does need to be clipped. Currently the extent is not calculated in the 'Integer Tile Domain' so we would have to iterate through all points to calculate the envelope. This would be additional processing that would slow down tiles that are not entirely enveloped by the bounding box of the clip. We calculate the original data's extent here: We could perhaps use this extent to limit what geometry is reprojected into the 'Integer Tile Domain' in the case of multipolygons and multi-lines, and geometry collections, however, this runs the risk of throwing out points that might be introduced into the clipping domain based on simplification. Granted this is a small risk, but it might be possible to have one tile missing the segment of a line that was simplified in other geometries. Not certain if this is more then just a concern I can dream up. |
Notes after talking with @springmeyer on this on a call:
For these reasons and the time required to answer these that this has been removed from the 0.8.5 milestone and is moved to the 0.8.6 milestone. |
After working on #135 and thinking more the biggest concerns I have about this change are the following:
Due to these requirements I am not certain it is a time saver to skip clipping on polygon / polygon parts completely with in the bounds. Currently there is no bounding box calculation in the integer space of the vector tile coordinates therefore, this might not be a worthwild extra step. |
I'm much less doubtful. I think there is still an obvious optimization here. Code challenges aside my logic is this:
|
@flippmoke let's revisit this ticket. From a performance standpoint we can gain from this. And from a testing standpoint this has increasing value. So, as we are now close to having tests in place for all the clipper options that can be considered (and called) independently of actual clipping (
|
@springmeyer problem here is that strictly_simple and its algorithm are a part of the clipping algorithm.
|
@flippmoke my understanding from talking to you earlier is that you said this is not a blocker because |
Now that clipping is done separately (via We should:
I predict that this could help performance with low zoom tiles with lots of dense data. It of course will not likely help with higher zoom tiles that only interest data that always crosses tile extents. refs mapnik-vector-tile/src/vector_tile_geometry_clipper.hpp Lines 209 to 216 in 03fef70
/cc @artemp |
If this is faster, we should be putting this code directly into wagyu and not here. I have doubts about the ability for it to increase performance on the aggregate but created mapbox/wagyu#85 to investigate this at some point. |
This is an obvious optimization, but was not possible before the new mapnik::geometry structure. Now it should be easy to check the bbox of a geometry (or even a single part of a multigeometry) and skip running it through clipping when not needed.
This should help performance significantly when rendering dense data at low zoom levels (when the majority of the features are not getting clipped even when run through the clipping pathway).
Steps toward this:
The text was updated successfully, but these errors were encountered: