summaryrefslogtreecommitdiff
path: root/vendor/github.com/golang/geo/s2/loop.go
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2017-03-19 15:19:42 +0000
committerFelix Hanley <felix@userspace.com.au>2017-03-19 15:19:42 +0000
commit8a541d499b6f117cd3a81e475ee779ba60fc0637 (patch)
tree7b3b5326235725ab93056b5ff4637d987fb0a7b6 /vendor/github.com/golang/geo/s2/loop.go
parentfe847b2d01060044274d20d2c35ae01a684d4ee3 (diff)
downloadcrjw-maps-master.tar.gz
crjw-maps-master.tar.bz2
use golang dep tool for depsHEADmaster
Diffstat (limited to 'vendor/github.com/golang/geo/s2/loop.go')
-rw-r--r--vendor/github.com/golang/geo/s2/loop.go20
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()