Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

omarestrella/simplify.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

simplify.py

simplify.py is a simple port of simplify.js by Vladimir Agafonkin (https://github.com/mourner/simplify-js)

Usage

import simplify
simplify(points, tolerance, highQuality)

points: An array of dictionaries, containing x, y coordinates: {'x': int/float, 'y': int/float}

tolerance (optional, 0.1 by default): Affects the amount of simplification that occurs (the smaller, the less simplification).

highestQuality (optional, True by default): Flag to exclude the distance pre-processing. Produces higher quality results, but runs slower.