/// <summary> /// /// </summary> /// <returns></returns> protected override Envelope ComputeEnvelopeInternal() { if (IsEmpty) { return(new Envelope()); } //Convert to array, then access array directly, to avoid the function-call overhead //of calling Getter millions of times. ToArray may be inefficient for //non-BasicCoordinateSequence CoordinateSequences. [Jon Aquino] var coordinates = _points.ToCoordinateArray(); double minx = coordinates[0].X; double miny = coordinates[0].Y; double maxx = coordinates[0].X; double maxy = coordinates[0].Y; for (int i = 1; i < coordinates.Length; i++) { minx = minx < coordinates[i].X ? minx : coordinates[i].X; maxx = maxx > coordinates[i].X ? maxx : coordinates[i].X; miny = miny < coordinates[i].Y ? miny : coordinates[i].Y; maxy = maxy > coordinates[i].Y ? maxy : coordinates[i].Y; } return(new Envelope(minx, maxx, miny, maxy)); }