I am trying to find a way of checking if a pair of lat/lng coordinates are within an area (generated by other lat/lng coordinates).
For example, if my area is a rectangle generated with these coordinates:
43.672162 , -79.43585
43.629845 , -79.314585
And I wanted to check if these coordinates are within that area:
43.651989 , -79.371993
I have tried using this package but I can't make it work: github.com/kellydunn/golang-geo
p1 := geo.NewPoint(coords[0].LatX, coords[0].LonX)
p2 := geo.NewPoint(coords[0].LatY, coords[0].LonY)
geo.NewPolygon(p1, p2)
I was wondering if anyone has an implementation of this they can share, or any resources that can point me in the right direction? I am open to using google maps API as well.