* @param to the upper index
* @param threshold
*/
protected void buildSimplifiedNodeList(List<Node> wnew, int from, int to, double threshold, List<Node> simplifiedNodes) {
Node fromN = wnew.get(from);
Node toN = wnew.get(to);
// Get max xte
int imax = -1;
double xtemax = 0;
for (int i = from + 1; i < to; i++) {
Node n = wnew.get(i);
double xte = Math.abs(EARTH_RAD
* xtd(fromN.getCoor().lat() * Math.PI / 180, fromN.getCoor().lon() * Math.PI / 180, toN.getCoor().lat() * Math.PI
/ 180, toN.getCoor().lon() * Math.PI / 180, n.getCoor().lat() * Math.PI / 180, n.getCoor().lon() * Math.PI
/ 180));
if (xte > xtemax) {
xtemax = xte;
imax = i;
}