fixed #64, nearby wrap-around issue

This commit is contained in:
Josh Baker 2016-10-12 15:15:07 -07:00
parent dad63f9b1f
commit 6c57c663d3
1 changed files with 3 additions and 0 deletions

View File

@ -177,5 +177,8 @@ func BBoxesFromCenter(lat, lon, meters float64) (outer BBox) {
outer.Min.Y, _ = geo.DestinationPoint(lat, lon, meters, 180) outer.Min.Y, _ = geo.DestinationPoint(lat, lon, meters, 180)
_, outer.Min.X = geo.DestinationPoint(lat, lon, meters, 270) _, outer.Min.X = geo.DestinationPoint(lat, lon, meters, 270)
_, outer.Max.X = geo.DestinationPoint(lat, lon, meters, 90) _, outer.Max.X = geo.DestinationPoint(lat, lon, meters, 90)
if outer.Min.X > outer.Max.X {
outer.Min.X = -(360 - outer.Min.X)
}
return outer return outer
} }