code: function polygonRemoveDuplicatePoints(polygon, precision){
      for(var i=polygon.length-1; i>=1; --i){
          var pi = polygon[i];
          for(var j=i-1; j>=0; --j){
              if(points_eq(pi, polygon[j], precision)){
                  polygon.splice(i,1);
                  continue;
              }
          }
      }
  }
docs: Remove duplicate points in the polygon.
  @method removeDuplicatePoints
  @param  {Number} [precision] The threshold to use when determining whether two points are the same. Use zero for best precision.