Android-Geofence-21 icon indicating copy to clipboard operation
Android-Geofence-21 copied to clipboard

can't draw custom geofence with irregular(polygonal) shape

Open kawadkarrocky opened this issue 9 years ago • 3 comments

Hey there, I was tried this tutorial it works very well, but I need to draw geofence with irregular shape like polygon since the Google maps API suggested to use Geofence.Builder() class to build the geofence with its regular circular shape but have no implentational methods to draw polygon of irregular shape. also I tried to built it by Polygon options but unable to find area of interior of polygon so please will anyone help me to find the interior area of that shape so to allow notification whenever user enters in that polygonal area and notifying when exiting that area, thank you.

kawadkarrocky avatar May 11 '17 11:05 kawadkarrocky

As far as I know, a geofence must be a circle since it's created by passing it a latitude, a longitude and a radius. It's possible to represent it on a map using a circle to which you pass a latlng and a radius.

vhoen avatar May 11 '17 12:05 vhoen

Hello Sir, but what if I want to create my custom GeoFence of any polygon say rectangle of regular shape by taking all the area inside the rectangle, so is there any way possible to do that????????? by considering latlng of all interior part of rectangle. any help would be appreciated....

kawadkarrocky avatar May 11 '17 12:05 kawadkarrocky

I do understand your problem, but as far as I know, it can't be done (I would be glad to be proved wrong). The only way I can think of is to create a geofence that covers your polygonal area. Also, bear in mind that the accuracy range can be a little off

vhoen avatar May 11 '17 12:05 vhoen