Working auth and photo json endpoint
Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
parent
ef275f97f4
commit
e4323b6047
2032 changed files with 821464 additions and 52 deletions
41
vendor/gopkg.in/ugjka/go-tz.v2/tz/bound.go
generated
vendored
Normal file
41
vendor/gopkg.in/ugjka/go-tz.v2/tz/bound.go
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
package tz
|
||||
|
||||
import "math"
|
||||
|
||||
func getBoundingBox(points []Point) []Point {
|
||||
if len(points) == 0 {
|
||||
return []Point{{0, 0}, {0, 0}}
|
||||
}
|
||||
|
||||
minX := math.Inf(1)
|
||||
minY := math.Inf(1)
|
||||
|
||||
maxX := math.Inf(-1)
|
||||
maxY := math.Inf(-1)
|
||||
|
||||
for _, v := range points {
|
||||
minX = math.Min(minX, v.Lon)
|
||||
minY = math.Min(minY, v.Lat)
|
||||
|
||||
maxX = math.Max(maxX, v.Lon)
|
||||
maxY = math.Max(maxY, v.Lat)
|
||||
}
|
||||
|
||||
return []Point{
|
||||
{math.Min(minX, maxX), math.Min(minY, maxY)},
|
||||
{math.Max(minX, maxX), math.Max(minY, maxY)},
|
||||
}
|
||||
}
|
||||
|
||||
func inBoundingBox(box []Point, point *Point) bool {
|
||||
|
||||
if point.Lat < box[0].Lat || box[1].Lat < point.Lat {
|
||||
return false
|
||||
}
|
||||
|
||||
if point.Lon < box[0].Lon || box[1].Lon < point.Lon {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue