mirror of https://github.com/tidwall/tile38.git
Fix nearby fast-fail
This commit is contained in:
parent
a160fa0860
commit
b2203fcb97
|
@ -674,9 +674,9 @@ func (c *Collection) Nearby(
|
|||
cursor Cursor,
|
||||
iter func(id string, obj geojson.Object, fields []float64) bool,
|
||||
) bool {
|
||||
|
||||
// First look to see if there's at least one candidate in the circle's
|
||||
// outer rectangle. This is a fast-fail operation.
|
||||
if circle, ok := target.(*geojson.Circle); ok {
|
||||
|
||||
meters := circle.Meters()
|
||||
if meters > 0 {
|
||||
center := circle.Center()
|
||||
|
@ -692,12 +692,12 @@ func (c *Collection) Nearby(
|
|||
},
|
||||
)
|
||||
if !exists {
|
||||
return true
|
||||
}
|
||||
// no candidates
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// do the kNN operation
|
||||
alive := true
|
||||
center := target.Center()
|
||||
var count uint64
|
||||
|
|
Loading…
Reference in New Issue