Book Image

ArcGIS By Example

By : Hussein Nasser
Book Image

ArcGIS By Example

By: Hussein Nasser

Overview of this book

Table of Contents (17 chapters)
ArcGIS By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.

Note

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...