phpgeo icon indicating copy to clipboard operation
phpgeo copied to clipboard

Geofence from point

Open rgonzalez-in opened this issue 2 years ago • 1 comments

Hello:

How create a Geofence from a Point with Buffer?

Regards.

rgonzalez-in avatar Feb 13 '23 14:02 rgonzalez-in

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

acleon avatar Mar 29 '24 10:03 acleon