Skip to content
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

St_AsMVTGeom: Shortcut geometries smaller than the tolerance #288

Closed
wants to merge 1 commit into from

Conversation

@Algunenano
Copy link
Member

commented Aug 27, 2018

St_AsMVTGeom drops geometries when they get too small after snapping them to the final grid. With this PR we now try to drop those geometries right away so they don't have to go through lwgeom_remove_repeated_points_in_place + lwgeom_simplify_in_place + lwgeom_clip_by_rect + lwgeom_affine + lwgeom_grid_in_place unnecessarily.

This doesn't have any noticeable performance impact in point datasets or when the geometries are bigger* than the tolerance ( < ±5% performance difference testing whole tile generation), but it's a nice improvement for low zoom tiles (bigger tolerance, more geometries dropped), almost halving some of the timings: mvt_0827_trunk_vs_mvt_0827_shortcut.pdf

*Bigger as in, it's bounding box max size is bigger than the tolerance, which is set to 1/2 * tile_size / tile_extent.

This PR also means a small additional change that can be considered both a drawback or an improvement: Due to how the simplification functions work, some super small geometries could go through the simplification process if they were between grid borders; so for a set of geometries with the same shape and size, some might appear and some don't depending on their position in the grid. With this PR this should be more consistent.

Trac issue: https://trac.osgeo.org/postgis/ticket/4161

@Algunenano Algunenano force-pushed the Algunenano:shortcut_small_mvt branch from d47cd8d to 5272195 Aug 29, 2018

@strk strk closed this in e5c92b1 Aug 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.