Using VB.NET I created a 3D polygon in ArcGIS to model a fault plane and now I want to find two different distances from a point on earth's surface. How to go about this? Can some one help with the code?
I have used following code to create polygon with 4 points. For example Lat1, long1, z1 are latitude, longitude and depth of the first vertex. Now I need to find the following distances:
Nearest distance from a point (Defined by its own lat and long) on earth's surface to the 3-D surface
Nearest distance from the same point to the polygon formed by projecting this 3-D polygon on earth's surface
Dim pPoint As IPoint = New PointClass() Dim pPointCollection As IPointCollection = New RingClass() Dim pGeomCollection As IGeometryCollection = New PolygonClass() pPoint.PutCoords(lat1, long1) pPoint.Z = Z1 pPointCollection.AddPoint(pPoint) pPoint.PutCoords(lat2, long2) pPoint.Z = Z2 pPointCollection.AddPoint(pPoint) pPoint.PutCoords(lat3, long3) pPoint.Z = Z3 pPointCollection.AddPoint(pPoint) pPoint.PutCoords(lat4, long4) pPoint.Z = Z4 pPointCollection.AddPoint(pPoint) pGeomCollection.AddGeometry(pPointCollection) Dim pOutGeometry As IGeometry = CType(pGeomCollection, IGeometry) Dim pZaware As IZAware = CType(pOutGeometry, IZAware) pZaware.ZAware = True
For the first distance, we can use "Near Tool" in ArcGIS but I am not knowing how to initiate that and find the distance.For the other distance we can form a 2D polygon by ignoring the Z values of vertices and use the same Near Tool. Please help me with the code for this idea.