@@ -38,16 +38,16 @@ import (
38
38
//
39
39
// Polygons have the following restrictions:
40
40
//
41
- // - Loops may not cross, i.e. the boundary of a loop may not intersect
42
- // both the interior and exterior of any other loop.
41
+ // - Loops may not cross, i.e. the boundary of a loop may not intersect
42
+ // both the interior and exterior of any other loop.
43
43
//
44
- // - Loops may not share edges, i.e. if a loop contains an edge AB, then
45
- // no other loop may contain AB or BA.
44
+ // - Loops may not share edges, i.e. if a loop contains an edge AB, then
45
+ // no other loop may contain AB or BA.
46
46
//
47
- // - Loops may share vertices, however no vertex may appear twice in a
48
- // single loop (see Loop).
47
+ // - Loops may share vertices, however no vertex may appear twice in a
48
+ // single loop (see Loop).
49
49
//
50
- // - No loop may be empty. The full loop may appear only in the full polygon.
50
+ // - No loop may be empty. The full loop may appear only in the full polygon.
51
51
type Polygon struct {
52
52
loops []* Loop
53
53
@@ -581,13 +581,13 @@ func (p *Polygon) LastDescendant(k int) int {
581
581
}
582
582
583
583
// CapBound returns a bounding spherical cap.
584
- func (p * Polygon ) CapBound () Cap { return p .bound .CapBound () }
584
+ func (p Polygon ) CapBound () Cap { return p .bound .CapBound () }
585
585
586
586
// RectBound returns a bounding latitude-longitude rectangle.
587
- func (p * Polygon ) RectBound () Rect { return p .bound }
587
+ func (p Polygon ) RectBound () Rect { return p .bound }
588
588
589
589
// ContainsPoint reports whether the polygon contains the point.
590
- func (p * Polygon ) ContainsPoint (point Point ) bool {
590
+ func (p Polygon ) ContainsPoint (point Point ) bool {
591
591
// NOTE: A bounds check slows down this function by about 50%. It is
592
592
// worthwhile only when it might allow us to delay building the index.
593
593
if ! p .index .IsFresh () && ! p .bound .ContainsPoint (point ) {
@@ -611,7 +611,7 @@ func (p *Polygon) ContainsPoint(point Point) bool {
611
611
}
612
612
613
613
// ContainsCell reports whether the polygon contains the given cell.
614
- func (p * Polygon ) ContainsCell (cell Cell ) bool {
614
+ func (p Polygon ) ContainsCell (cell Cell ) bool {
615
615
it := p .index .Iterator ()
616
616
relation := it .LocateCellID (cell .ID ())
617
617
@@ -635,7 +635,7 @@ func (p *Polygon) ContainsCell(cell Cell) bool {
635
635
}
636
636
637
637
// IntersectsCell reports whether the polygon intersects the given cell.
638
- func (p * Polygon ) IntersectsCell (cell Cell ) bool {
638
+ func (p Polygon ) IntersectsCell (cell Cell ) bool {
639
639
it := p .index .Iterator ()
640
640
relation := it .LocateCellID (cell .ID ())
641
641
@@ -663,7 +663,7 @@ func (p *Polygon) IntersectsCell(cell Cell) bool {
663
663
}
664
664
665
665
// CellUnionBound computes a covering of the Polygon.
666
- func (p * Polygon ) CellUnionBound () []CellID {
666
+ func (p Polygon ) CellUnionBound () []CellID {
667
667
// TODO(roberts): Use ShapeIndexRegion when it's available.
668
668
return p .CapBound ().CellUnionBound ()
669
669
}
0 commit comments