Skip to content

Instantly share code, notes, and snippets.

View mbloch's full-sized avatar

Matthew Bloch mbloch

View GitHub Profile
git clone git@github.com:newsdev/mapmaker.git
@mbloch
mbloch / README.md
Last active August 29, 2015 14:05
Some more weighting functions for Visvalingam simplification

Legend

The charts on the left show the output of several weighting functions, from 0 degrees to 180 degrees. The blue lines show y = 1, equivalent to no weighting.

The right-hand charts show the result of applying each weighting function to isosceles triangles with legs of length 1 and vertex angles from 0 to 180 degrees. The blue lines show unweighted area.

D

This function is used by Mapshaper v0.2.3

@mbloch
mbloch / README.md
Last active August 29, 2015 14:05
Some weighting functions for Visvalingam simplification

The charts on the left show the output of several weighting functions, from 0 degrees to 180 degrees. The blue lines show y = 1, equivalent to no weighting.

The right-hand charts show the result of applying each weighting function to isosceles triangles with legs of length 1 and vertex angles from 0 to 180 degrees. The blue lines show unweighted area.

The unweighted (blue) curve peaks at 90 degrees, suggesting that the effective area metric favors angles close to 90 degrees. Functions C and D peak at 120 degrees. These functions favor oblique angles and strongly disfavor very acute angles.