aboutsummaryrefslogtreecommitdiff
path: root/geo
diff options
context:
space:
mode:
Diffstat (limited to 'geo')
-rw-r--r--geo/interval.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/geo/interval.go b/geo/interval.go
new file mode 100644
index 0000000..33985d0
--- /dev/null
+++ b/geo/interval.go
@@ -0,0 +1,15 @@
+package geo
+
+// Interval is an inclusive index range [Start, End] over position data, used
+// to refer to a stretch of a route by point indexes.
+type Interval struct {
+ Start, End int
+}
+
+// NewInterval returns an Interval with the given start and end indexes.
+func NewInterval(start, end int) Interval {
+ return Interval{
+ Start: start,
+ End: end,
+ }
+}