You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will OperatorDisjoint work for you?
Here is an example of how to use it.
Point point = new Point(1, 1);
Polygon polygon = new Polygon();
polygon.startPath(0, 0);
polygon.lineTo(0, 3);
polygon.lineTo(3, 3);
polygon.lineTo(3, 0);
SpatialReference spatialRef = SpatialReference.create(4326);
// Returns false in this case meaning that the point is in the polygon
boolean disjoint = OperatorDisjoint.local().execute(point, polygon, spatialRef, null);
@SiefSeif Use OperatorDisjoint. Avoid creating objects in a loop, you could also move OperatorDisjoint.local() call outside of the loop. The spatial reference is used to extract a tolerance value of about 1 mm and is used close to polygon borders, you can pass null spatial reference if you don't care about the tolerance.
Activity
alocke commentedon Oct 16, 2017
Hi, which methods do you want to use?
SiefSeif commentedon Oct 17, 2017
I want to use functions for geofencing, PolygonUtils.isPointInPolygon2D()
alocke commentedon Oct 17, 2017
Will OperatorDisjoint work for you?
Here is an example of how to use it.
SiefSeif commentedon Oct 18, 2017
Yes, this works for me, thank you. but is it the best and fastest way? because i'm working on bigdata use case... will PolygonUtils be faster?
stolstov commentedon Oct 18, 2017
@SiefSeif Use OperatorDisjoint. Avoid creating objects in a loop, you could also move OperatorDisjoint.local() call outside of the loop. The spatial reference is used to extract a tolerance value of about 1 mm and is used close to polygon borders, you can pass null spatial reference if you don't care about the tolerance.