ramer-douglas-peucker algorithm, saving points between chcekpoint, dunno how to test