diff options
| author | Felix Hanley <felix@userspace.com.au> | 2017-03-19 15:19:42 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2017-03-19 15:19:42 +0000 |
| commit | 8a541d499b6f117cd3a81e475ee779ba60fc0637 (patch) | |
| tree | 7b3b5326235725ab93056b5ff4637d987fb0a7b6 /vendor/github.com/golang/geo/s2/loop.go | |
| parent | fe847b2d01060044274d20d2c35ae01a684d4ee3 (diff) | |
| download | crjw-maps-master.tar.gz crjw-maps-master.tar.bz2 | |
Diffstat (limited to 'vendor/github.com/golang/geo/s2/loop.go')
| -rw-r--r-- | vendor/github.com/golang/geo/s2/loop.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/golang/geo/s2/loop.go b/vendor/github.com/golang/geo/s2/loop.go index 4d54860..253e7d8 100644 --- a/vendor/github.com/golang/geo/s2/loop.go +++ b/vendor/github.com/golang/geo/s2/loop.go @@ -211,6 +211,26 @@ func (l Loop) Edge(i int) (a, b Point) { return l.Vertex(i), l.Vertex(i + 1) } +// dimension returns the dimension of the geometry represented by this Loop. +func (l Loop) dimension() dimension { return polygonGeometry } + +// numChains reports the number of contiguous edge chains in the Loop. +func (l Loop) numChains() int { + if l.isEmptyOrFull() { + return 0 + } + return 1 +} + +// chainStart returns the id of the first edge in the i-th edge chain in this Loop. +func (l Loop) chainStart(i int) int { + if i == 0 { + return 0 + } + + return l.NumEdges() +} + // IsEmpty reports true if this is the special "empty" loop that contains no points. func (l Loop) IsEmpty() bool { return l.isEmptyOrFull() && !l.ContainsOrigin() |
