mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-04 05:20:46 -04:00
Simplifying polygons means reducing the number of points used to render them. This commit implements simplification such that, for any given input polygons, the combined point count of the simplified polygons is less than 100. When simplifying the polygons we are trying to get the smallest number of points while meeting these two rules: 1. No part of the area the user has chosen can be cut off 2. The area of the simplified polygon should be as small as possible This commit introduces two techniques we weren’t using before: 1. Dilating and eroding the area to fill in concave details of the shape, like inlets and harbours[1] 2. Making the simplification threshold proportionate to the perimeter of all polygons, so bigger and crinklier polygons get more simplification applied It also shows the estimated bleed as a separate polygon. This lets us make it bigger (so it’s more closer the the approximate bleed) without having to send a bigger area to the CBC and compounding the amount of actual bleed. 1. Inspired by this blog post about ‘removing the crinkley bits’ from Vancouver Island: http://blog.cleverelephant.ca/2010/11/removing-complexities.html