what is the correct way to find whether a point on polygon or not in ArcGIS VB.NET?

المشرف العام

Administrator
طاقم الإدارة
I am working on GIS application. I am trying to find whether a point is located within a polygon or not. I have written a piece of code for this using Relational operator but the Contains() method of it always returns false. Can you please Help?

Private Function CreateNearestPointOnPolygon(pPoint As IPoint, ByRef pFeature As IFeature) As geoCode Dim pPoint2 As IPoint pPoint2 = New Point Dim pRelOp As IRelationalOperator pRelOp = pFeature.Shape Dim res As Boolean res = pRelOp.Contains(pPoint) Dim pProximity As IProximityOperator pProximity = pFeature.Shape pPoint2 = pProximity.ReturnNearestPoint(pPoint, esriSegmentExtension.esriNoExtension) Dim Geo2 As geoCode Geo2.lon = pPoint2.X Geo2.lat = pPoint2.Y Return Geo2 End Function

أكثر...
 
أعلى