移除重复点

@param {Array} points 点集合
@return {Array} 移除后点集合
491662
function removeOverlapPoints(points) {
            var hash = {};
            var ret = [];
            for (var i = 0, l = points.length; i < l; i++) {
                var hashcode = points[i].x * 31 + points[i].y;
                if (!hash[hashcode]) {
                    ret.push(points[i]);
                    hash[hashcode] = 1;
                }
            }
            return ret;
        }
785141
public MultiPoint createMultiPoint(Point[] points) {
		if (points == null) {
			return new MultiPoint(srid, precision);
		}
		Point[] clones = new Point[points.length];
		for (int i = 0; i < points.length; i++) {
			clones[i] = (Point) points[i].clone();
		}
		return new MultiPoint(srid, precision, clones);
	}
820980
function (points) {
    return new BVG('polyline', points.constructor.name === 'Object' ? points : {
      points: points
    }, function (tag, data) {
      tag.setAttribute('points', data.points.join(' '));
    });
  }
827419
function(point) {
      let x_ = null;
      let y_ = null;
      if (point[0] == extent[0]) {
        x_ = extent[2];
      } else if (point[0] == extent[2]) {
        x_ = extent[0];
      }
      if (point[1] == extent[1]) {
        y_ = extent[3];
      } else if (point[1] == extent[3]) {
        y_ = extent[1];
      }
      if (x_ !== null && y_ !== null) {
        return [x_, y_];
      }
      return null;
    }
545900
function parsePointsAttribute(points) {

    // points attribute is required and must not be empty
    if (!points) return null;

    points = points.trim();
    var asPairs = points.indexOf(',') > -1;

    points = points.split(/\s+/);
    var parsedPoints = [ ];

    // points could look like "10,20 30,40" or "10 20 30 40"
    if (asPairs) {
     for (var i = 0, len = points.length; i < len; i++) {
       var pair = points[i].split(',');
       parsedPoints.push({ x: parseFloat(pair[0]), y: parseFloat(pair[1]) });
     }
    }
    else {
      for (var i = 0, len = points.length; i < len; i+=2) {
        parsedPoints.push({ x: parseFloat(points[i]), y: parseFloat(points[i+1]) });
      }
    }

    // odd number of points is an error
    if (parsedPoints.length % 2 !== 0) {
      // return null;
    }

    return parsedPoints;
  }
570647
public Point[] points() {
        Point[] points = new Point[width * height];
        int k = 0;
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                points[k++] = new Point(x, y);
            }
        }
        return points;
    }
1173623
def clean_points(points):
    
    if not points:
        return points

    result = [points[0]]
    for point in points:
        if point != result[-1]:
            result.append(point)
    return result
1267689
function pointsToCoordArray(points) {
                var coodinatesArray = new Array(points.length * points[0].length);
                var k = 0;
                for (var i = 0; i < points.length; ++i) {
                    for (var j = 0; j < points[0].length; ++j) {
                        coodinatesArray[k] = points[i][j];
                        ++k;
                    }
                }

                return coodinatesArray;
            }
357267
function _getSegmentPoints(segment) {
  var points = [];
  switch (segment[0]) {
    case 'M':
      points.push([segment[1], segment[2]]);
      break;
    case 'L':
      points.push([segment[1], segment[2]]);
      break;
    case 'A':
      points.push([segment[6], segment[7]]);
      break;
    case 'Q':
      points.push([segment[3], segment[4]]);
      points.push([segment[1], segment[2]]);
      break;
    case 'T':
      points.push([segment[1], segment[2]]);
      break;
    case 'C':
      points.push([segment[5], segment[6]]);
      points.push([segment[1], segment[2]]);
      points.push([segment[3], segment[4]]);
      break;
    case 'S':
      points.push([segment[3], segment[4]]);
      points.push([segment[1], segment[2]]);
      break;
    case 'H':
      points.push([segment[1], segment[1]]);
      break;
    case 'V':
      points.push([segment[1], segment[1]]);
      break;
    default:

  }
  return points;
}
1244824
function(points, panLines, smoothFactor) {

                var result = {};

                Utils.each(points, function(point, index) {

                    //当前平移线
                    var currentPanLine = panLines[index],
                        //平移线中点
                        center = currentPanLine.center,

                        //移动距离
                        distance = {
                            x: center.x - point.x,
                            y: center.y - point.y
                        };

                    var currentResult = result[index] = {
                        points: [],
                        center: {
                            x: point.x,
                            y: point.y
                        }
                    };

                    //计算控制点到顶点的距离， 并且应用平滑系数到距离上
                    Utils.each(currentPanLine.points, function(controlPoint, index) {
                        var moved = {
                            x: controlPoint.x - distance.x,
                            y: controlPoint.y - distance.y
                        };
                        var vertex = currentResult.center;
                        var dx = moved.x - vertex.x;
                        var dy = moved.y - vertex.y;
                        moved.x = vertex.x + smoothFactor * dx;
                        moved.y = vertex.y + smoothFactor * dy;
                        currentResult.points.push(moved);
                    });

                });

                return result;

            }
1222726
def points=(array)
      raise ArgumentError unless array.is_a? Array
      @points = []
      array.each {|point| self << point}
    end
152677
function(points, angle) {
    var result = [];
    for(var i=0;i<points.length;i+=2) {
      var x = points[i + 0] * this._size;
      var y = points[i + 1] * this._size;
      var pt = this._rotate([x, y], angle);
      result.push(pt[0]);
      result.push(pt[1]);
    }
    return result;
  }
1345850
function(points, bbox) {
        for (var i = 0; i < points.length; i++) {
            if (this.bboxContainsPoint(points[i], bbox))
                return true;
        }
        return false;
    }
126524
function(coords) {
        var tolerance = this.options.tolerance || 0.8;
        var enableHighQuality = !!this.options.highQuality;
        var points = GeometryUtils.simplify(coords, tolerance,
                enableHighQuality);
        return points;
    }
741719
public Collection<Line> getPoints()
    {
        final Collection<Line> list = new ArrayList<>(npoints);
        for (int i = 0; i < npoints / 2; i++)
        {
            list.add(new Line(xpoints[i], ypoints[i], xpoints[i + npoints / 2], ypoints[i + npoints / 2]));
        }
        return list;
    }
1068663
function (x, y) {
            if (this.indices.length === 0) {
                var points = this.points;
                var data = [];

                // flatten the points vector array
                for (var i = 0; i < points.length; i++) {
                    // XXX Optimize me
                    data.push(points[i].x);
                    data.push(points[i].y);
                }
                this.indices = earcut(data);
            }
            return this.indices;
        }
201699
def points(self):
        
        feature = geojson.Feature(geometry=self._geom)
        points_coords = list(geojson.utils.coords(feature))
        return [Point(p[0], p[1]) for p in points_coords]