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

Calculating the tree removal cost


In this section, we will continue working on our cost calculator class and add more functionalities to it. We will add the ability to calculate the number of trees under a certain excavation and then we will also calculate the cost of removing those trees based on their type.

Calculating the number of trees

To calculate the number of trees, we will need to perform a spatial query on the tree feature class to find all trees under the current selected excavation.

  1. If necessary, open Visual Studio Express in administrator mode; we need to do this since our project is actually writing to the registry this time, so it needs administrator permissions. To do that, right-click on Visual Studio and click on Run as administrator.

  2. Go to File, then click on Open Project, browse to the Yharnam project from the C:\ArcGISByExample\yharnam\Code, and click on Open.

  3. Double-click on ExcavationCostCalculator.vb to edit the code.

  4. We will first need to get the tree feature class—we...