Implementation of the Douglas-Peucker line simplification algorithm