diff --git a/Gopkg.lock b/Gopkg.lock index bf224bfa..84f75a23 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -227,7 +227,7 @@ [[projects]] branch = "master" - digest = "1:6fc1b77dedecd24d417a38c4ffc580c0c4de1540b60453efee44f1a41b205d27" + digest = "1:4be7626fb8f801eb85aa7494ce3a504c9b4121a07f4ec19d7d204185bd6397d5" name = "github.com/tidwall/geojson" packages = [ ".", @@ -235,7 +235,7 @@ "geometry", ] pruneopts = "" - revision = "581e33d25c96a70d4006cbeca5fcd716caad7766" + revision = "928ede3da18d831dea0af0bb26adeb025145c23b" [[projects]] digest = "1:3ddca2bd5496c6922a2a9e636530e178a43c2a534ea6634211acdc7d10222794" diff --git a/internal/controller/search.go b/internal/controller/search.go index 038f9b8c..e1651e14 100644 --- a/internal/controller/search.go +++ b/internal/controller/search.go @@ -425,7 +425,7 @@ func (c *Controller) nearestNeighbors( return true } dist := o.Distance(target) - if s.obj.(*geojson.Circle).Meters > 0 && dist > s.obj.(*geojson.Circle).Meters { + if target.(*geojson.Circle).Meters() > 0 && dist > target.(*geojson.Circle).Meters() { return false } items = append(items, iterItem{id: id, o: o, fields: fields, dist: dist}) diff --git a/vendor/github.com/tidwall/geojson/circle.go b/vendor/github.com/tidwall/geojson/circle.go index 8f528351..12de3dc6 100644 --- a/vendor/github.com/tidwall/geojson/circle.go +++ b/vendor/github.com/tidwall/geojson/circle.go @@ -70,3 +70,11 @@ func (g *Circle) JSON() string { func (g *Circle) String() string { return string(g.AppendJSON(nil)) } + +func (g *Circle) Meters() float64 { + return g.meters +} + +func (g *Circle) Center() geometry.Point { + return g.center +}