I am trying to find if a given LatLng exists in a Desired area.
I am using github.com/golang/geo/s2
.
rect := s2.RectFromLatLng(s2.LatLng{0.0, 0.0})
rect = rect.AddPoint(s2.LatLng{2.0, 2.0})
isThere := rect.ContainsLatLng(s2.LatLng{1.0, 1.0})
fmt.Printf("%+v", rect.Hi())
fmt.Printf("%+v", rect.Lo())
println(isThere)
I'm expecting it to return true
but it gives false. Also, rect.Hi()
and rect.Lo()
are same.
Could someone help me understand it better, what I am doing wrong?
Thanks