phpgeo
phpgeo copied to clipboard
Geofence from point
Hello:
How create a Geofence from a Point with Buffer?
Regards.
Assuming you want a circular geofence around a point, you need to travel the "buffer" distance in various directions from your start point, then use those points to form a ring polygon. The key object here is the bearing calculator - either BearingSpherical
or BearingEllipsoidal
.
Here's a Gist showing the approach....
https://gist.github.com/acleon/0237a69dc75a23fb7dc81724c961b1ba