I have a Point which obtained through a long press MotionEvent.
Point mapPoint = mMapView.screenToLocation(new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())));
However, I need to verify if the point is lying within the polygon. I can't find any API in Geometry which allows me to check if the point is located inside the polygon.
Any idea?
Solved! Go to Solution.
Hi Kae,
The GeometryEngine class has lots of geometry-on-geometry spatial operations - you can try the GeometryEngine.contains static method - GeometryEngine (ArcGIS Runtime SDK for Android 100.7.0) . There's a sample that demonstrates this method, along with a lot of other spatial relationships like intersects, within, etc - Spatial Relationships | ArcGIS for Developers .
Hope this helps,
Shelly
Hi Kae,
The GeometryEngine class has lots of geometry-on-geometry spatial operations - you can try the GeometryEngine.contains static method - GeometryEngine (ArcGIS Runtime SDK for Android 100.7.0) . There's a sample that demonstrates this method, along with a lot of other spatial relationships like intersects, within, etc - Spatial Relationships | ArcGIS for Developers .
Hope this helps,
Shelly
Yes, Thanks! I just found the functions which works like magic.
boolean isContain = GeometryEngine.contains(p, ltLn);