Finding the distance between two points
In this section, we will learn about the proximity operators, which will help us to
calculate the distance between two points. We will then use this to find the distance
between the cell phone location and the tower. This will help us find the closest
tower, which will be the connected tower.
Proximity operator: This is an ArcObject method that returns the
minimum distance between two geometric shapes. It works on points,
lines, and polygon geometries.
Finding the distance between two towers
We will test our proximity operator on two of the towers, T01 and T02, in the
TelZaViBa geodatabases to find the distance between them. We will get the T01 and
T02 features using their corresponding object IDs and then use the Shape property to
get the underlying point geometry under that. We do that by setting one geometry to
the proximity operator object, then calling the ReturnDistance method, and passing
the second geometry:
1. Open our TelZaViBa project from the
C:\ArcGISByExample\telzaviba\Code if you have closed it.
2. Double-click on btnShowTowerRange to open its code and add the following
code on the onClick event:
…
pDocument.ActiveView.Refresh
In this section, we will learn about the proximity operators, which will help us to
calculate the distance between two points. We will then use this to find the distance
between the cell phone location and the tower. This will help us find the closest
tower, which will be the connected tower.
Proximity operator: This is an ArcObject method that returns the
minimum distance between two geometric shapes. It works on points,
lines, and polygon geometries.
Finding the distance between two towers
We will test our proximity operator on two of the towers, T01 and T02, in the
TelZaViBa geodatabases to find the distance between them. We will get the T01 and
T02 features using their corresponding object IDs and then use the Shape property to
get the underlying point geometry under that. We do that by setting one geometry to
the proximity operator object, then calling the ReturnDistance method, and passing
the second geometry:
1. Open our TelZaViBa project from the
C:\ArcGISByExample\telzaviba\Code if you have closed it.
2. Double-click on btnShowTowerRange to open its code and add the following
code on the onClick event:
…
pDocument.ActiveView.Refresh
ليست هناك تعليقات:
إرسال تعليق