Menu

#6 Improvement in class DouglasPeuckerLineSimplifier

Unstable (example)
open
Dr JTS
None
5
2014-04-30
2013-12-26
No

Unnecessary to create a new instance of Coordinate in simplify() method of DouglasPeuckerLineSimplifier class.

Chance:

if (usePt[i]) {
     coordList.add(new Coordinate(pts[i]));
}

To:

if (usePt[i]) {
    coordList.add(pts[i]);
}

This way you can send N instances of a subclass Coordinate with other information of each point (eg the date).

Discussion


Log in to post a comment.