ArcGIS by Example - Sample Chapter

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

ArcGIS is a geographic information system (GIS) for

working with maps and geographic information. It is


considered as the turnkey solution to create and share
interactive maps. ArcGIS is designed to work the way you
work. With nothing to install and set up, ArcGIS helps you
make your work productive from day one.
This book covers the design and development of three
ArcGIS applications to guide readers in crafting their own
GIS solution as per their requirements. The book begins
by giving you a refresher on the concepts of ArcGIS.
You'll then begin developing your first ArcGIS application
and a cell tower analysis tool. Following this, you will be
guided through mapping signal strength and real-time
maneuvering in your GIS system. You will then move on to
the second application of the book: a restaurant mapping
system. You will then make use of Advanced ArcObjects
to develop your third application: an excavation planning
manager. The book will conclude by teaching you how to
work out excavation cost calculations and also save and
retrieve your excavation designs.

What you will learn from this book


Use essential ArcGIS code to query
geodatabases
Communicate with ArcGIS maps,
with the help of critical designing and
optimization tips
Highlight and interact with objects on
your map
Query ArcGIS geodatabases with related
data to display your information on ArcGIS

C o m m u n i t y

Edit your underlying geodatabase

E x p e r i e n c e

D i s t i l l e d

Explore strategies for the adaptation of


various types of spatial analysis techniques
in the GIS framework
Analyze tools for geographical information
systems and remote sensing

If you are an application developer who wishes to enhance


your skills for the GIS domain with ArcGIS, then this book
is for you. Previous experience with ArcGIS is not required.

Experience ArcGIS's advanced tools for


manipulation of geodatabases

$ 44.99 US
28.99 UK

Hussein Nasser

Who this book is written for

"Community
Experience
Distilled"

ArcGIS By Example

ArcGIS By Example

ArcGIS By Example
Develop three engaging ArcGIS applications to address your
real-world mapping scenarios

Prices do not include


local sales tax or VAT
where applicable

Visit www.PacktPub.com for books, eBooks,


code, downloads, and PacktLib.

Hussein Nasser

In this package, you will find:

The author biography


A preview chapter from the book, Chapter 1 'Getting Started with ArcGIS'
A synopsis of the books content
More information on ArcGIS By Example

About the Author


Hussein Nasser is an Esri award-winning senior GIS solution architect working

in the GIS field since 2006. He is the author of three books in the ArcGIS technology:
Administering ArcGIS for Server, Learning ArcGIS Geodatabases, and Building Web
Applications with ArcGIS, all by Packt Publishing. In 2007, he won the first place at the
annual ArcGIS Server Code Challenge, conducted at the Esri Developer Summit in
Palm Springs, California. In 2014, he started the IGeometry YouTube channel, where
he periodically publishes educational GIS videos.

Preface
Over the last two years, I have written three books on ArcGIS technology. Each
book covers different topics and fields of this increasingly ubiquitous technology.
Although I used examples and various real-life project approaches to explain the
technology in all my books, this is the first book where the content evolves with the
help of examples. I have been working with Esri ArcGIS since 2005 when ArcGIS 9.1
was released, so writing this title from a technological point of view was not difficult.
In fact, it was thrilling. The challenging part was to come up with three unique reallife examples and to build them up as I wrote the book. Each example should target
certain features of the technology and explain them along the way.
These three examples are all from my own imagination and they are not linked to or
correlate with any actual projects that I personally worked on or witnessed. You will
not find any of these examples in Esri's help or on any online resource. All the code
that is available in this book is written from scratch for this book that you are holding
in your hands.
The title of this book was designed for those who want to start using the ArcGIS
technology or have been using it and want to learn more about how they can
customize ArcGIS to do more. There are going to be three themes running
throughout the book. The first theme covers Chapter 2, App 1 the Cell Tower Analysis
Tool, Chapter 3, Mapping Signal Strength, and Chapter 4, Real-time Maneuvering, which
are tailored for beginners and developers. It features a Cell Tower Analysis Tool
that displays a cell phone tower's signal range and signal strength on the map and
shows you how cell phones connectin simulated real timeto the tower with the
strongest signal, all on top of ArcGIS for Desktop. You will learn ArcGIS add-ins for
development.

Preface

The second theme covers Chapter 5, App 2 - Extending ArcObjects, Chapter 6, Reviews
and Ratings, and Chapter 7, Advanced Searching, and is targeted at those who want to
achieve more with ArcGIS. This theme features a restaurant mapping application
that will be used to filter, search, and interact with restaurants on the map; it will also
be used to view the reviews and the ratings of different users. You will learn how to
write some ArcObjects code to work with geodatabases, query feature classes, and
relationships. The last theme covers Chapter 8, App 3 Advanced ArcObjects, Chapter
9, Excavation Cost Calculation, and Chapter 10, Saving and Retrieving Excavation Designs
and is designed for those who are willing to try advanced programming. This theme
features an excavation planning manager application. This application will propel
the reader to the advanced stage, where they will write a real-life business-related
deployable application. The Excavation Planning Manager helps construction
workers plan their excavation for utilities and telecom networks beforehand in
a given area and at an estimated cost of excavation. The application analyses the
underlying soil type and green area to find out the cost of removing these areas
by doing extensive spatial analysis. You will be able to store multiple designs of
excavation and determine which is the cheapest or most applicable design. Chapter
1, Getting Started with ArcGIS ties all the chapters together and explains briefly what
you will learn in all of them. It will also help you get started with the installations
and will also tell you about the prerequisites.
In each of the themes, you will learn new features of ArcGIS and will be able to
harness these features in your own code to enhance and extend ArcGIS capability.

What this book covers


Chapter 1, Getting Started with ArcGIS, introduces you to the book. Since you are
new to ArcGIS, it will briefly explain what ArcGIS is and why a developer would
customize ArcGIS to create cool applications with it. In this chapter, we illustrate
each example, the technology, and the skills that a developer will acquire upon
completing the example.
Chapter 2, App 1 the Cell Tower Analysis Tool, kicks off with the first example,
where you will learn how to develop on ArcGIS for Desktop using ArcGIS add-ins.
Developers will write a tool to show a cell phone tower's signal range, display the
strength signal on the map, and display how cell phones will connectin simulated
real timeto the tower with the strongest signal, all on ArcGIS for Desktop.

Preface

Chapter 3, Mapping Signal Strength, takes the application further to the next stage
where you will learn about proximity tools, how to use them to measure distances
between points, and perform analysis based on a result. This will help us in
determining the closest tower, which will eventually be the one with the strongest
signal. The signal strength can be calculated with the formula tower range-distance.
Chapter 4, Real-time Maneuvering, takes the application to a real-life scenario. In this
chapter, we simulate a cell phone that moves on the map and switches towers for the
best signal possible. The cell phone reads coordinates from a GPS textfile, which has
been produced previously. The active tower will keep flashing while the cell phone
is connected to that particular tower.
Chapter 5, App 2 Extending ArcObjects, introduces our second application, the
restaurant mapping application. You will create an application that will allow you
to filter, search, and interact with restaurants on the map. This will also help you to
view the reviews and ratings of different users. You will learn how to write some
ArcObjects code to work with geodatabase, query feature classes, and relationships.
Chapter 6, Reviews and Ratings, introduces you to the relationship queries, which
is a bit of an advanced topic that requires special care. You will be able to query
related tables, such as reviews and ratings, pull this information, and display it on
the application. A developer will learn how to highlight restaurants on the map by
selecting it from the application.
Chapter 7, Advanced Searching, takes the application to a higher level with the
advanced geodatabase search. In this chapter, we will introduce advanced spatial
queries, where the user of the application will select an area and the application
should display all the restaurants in the selected area according to their categories.
You will also perform an advanced interface technique, where the developer will add
a custom text box to the toolbar to search for restaurants and filter them accordingly
as the user types in the box.
Chapter 8, App 3 Advanced ArcObjects, will propel you to the advanced stage, where
you will write a real-life business-related deployable application. The Excavation
Planning Manager helps construction workers plan their excavation for utilities and
telecom networks beforehand in a given area and at an estimated cost of excavation.
The application analyses the underlying soil type and green area to find out the cost
of removing these areas by carrying out extensive spatial analysis. You will be able
to store multiple designs of excavation and determine which is the cheapest or most
applicable design.

Preface

Chapter 9, Excavation Cost Calculation, will help you use advanced spatial operations
to determine the estimated cost of a given excavation. The application will carry
out spatial analysis on the area under the excavation polygon, and based on the soil
type, the cost of removal of per 1 meter cube of soil might affect the overall cost of
excavation. For instance, a stony area is more difficult to excavate than a regular
sand area.
Chapter 10, Saving and Retrieving Excavation Designs, propels our application to the
real-life scenario. Before this chapter, excavations were scattered and ungrouped; in
this chapter, we will group excavations into designs. So here, a user can create a new
design and add multiple excavations for his/her design and calculate the total cost of
his/her design. A user will be able to search for a design, edit it, and delete it, along
with all its underlying features.

Getting Started with ArcGIS


Planning to build a product requires addressing a purpose and a goal. The product
needs to either fix a problem or tackle a limitation that current solutions are unable
to overcome. It might enter an existing market to compete with other products or it
might define its own market if such a market doesn't exist. Once a set of problems
to be solved are identified, a technology can then be used to build the product. Any
selected technology comes with its' perks and limitations. The author of the product
should be aware of them because they will eventually steer and shape his/her
solution. This is what Esri tried to achieve with ArcGIS and what we will discover
by the end of this book. In this chapter, we discuss the following topics:

The history of ArcGIS

An introduction to ArcGIS for Desktop

Customizing ArcGIS for Desktop

App 1 the cell tower analysis tool

App 2 the restaurant mapping application

App 3 the excavation planning manager

The history of ArcGIS


Esri, Environmental Systems Research Institute, knew there was a starving market
for location-based systems also known geographic information systems (GIS). In
1990s, Esri started working on a product that later became one of the best enterprise
solutions for GIS implementations on Windows systems. In 1999, ArcGIS was
released. Since then, ArcGIS has become the most used commercial GIS solution.
ArcGIS was then renamed ArcGIS for Desktop, and the ArcGIS name was used as a
product line instead to carry lots of products under it.

[1]

Getting Started with ArcGIS

When the Web started to become ubiquitous in early 2000s, Esri adopted the Web by
rolling in ArcGIS for Server and gradually ArcGIS functionalities as web services so
that it could be supported on multiple platforms including mobile phones.
A decade later when the cloud solutions began to surface, Esri released its Software
as a Service (SaaS) solution ArcGIS Online. Designed to simplify the user
experience, ArcGIS Online hides all the ArcGIS "contraptions" and technologies to
relieve the user from maintaining the hardware and software, leaving the user to do
what they do best, mapping. Having everything in the cloud allows users to focus
on their work instead of worrying about configurations, spinning up servers and
databases, and running optimization checks.
SaaS, a cloud-based software distribution model where all
infrastructure, hardware, management software, and applications are
hosted in the cloud. Users consume the applications as services without
the need to have high-end terminal machines.

Today, Esri is pushing to enhance and enrich the user experience and support
multiple platforms by using the ArcGIS Online technology.
In this book, we target one of the core products of the ArcGIS familyArcGIS for
Desktop. By using real-life examples, we will demonstrate the power and flexibility of
this 16+ year-old product ArcGIS for Desktop. We are going to use the various tools at
our disposable to show how we can extend the functionality of ArcGIS for Desktop.

An introduction to ArcGIS for Desktop


In this section, we will talk about ArcGIS for Desktop: What is it? How does it work?
What different components does it consist of? What does it require to run? We will
also explain about core ArcGIS concepts and will use the application out-of-the-box.
ArcGIS for Desktop was originally designed to allow users to author maps and
spatial data. The ability for analysis was added to this product to make it one of
the best GIS desktop solutions on the market. ArcGIS for Desktop consists of many
components. Firstly, ArcMap is the map authoring and viewing tool, and this is the
one we will be dealing with throughout this book. You can run tools on your map,
edit, analyze, or export your map to different formats to support other platforms.
The second component is ArcCatalog. You can use it to connect to geodatabases,
author your own geodatabases, manipulate datasets, feature classes, and much
more. We will be defining the ArcGIS geodatabase in the coming sections. You can
learn more about geodatabases in my other book Learning ArcGIS Geodatabases, Packt
Publishing. There are other products that come under the umbrella of Desktop like
ArcGlobe and ArcScene for 3D analysis, which are out of the scope of this book.
[2]

Chapter 1

ArcGIS for Desktop licenses


ArcGIS for Desktop has three different licenses: Basic, Standard, and Advanced
previously known as ArcView, ArcEditor, and ArcInfo, respectively. The Basic
license mainly gives you the viewer features, which allows you to read map
documents and query the data. You can, in fact, do simple editing with the Basic
license, but it is very limited. The Standard license is the editor, which allows you
to view, create, and edit maps and spatial data. It allows you to edit and create
complex data structures and allows multiple users to edit the same geodatabase.
The Advanced license allows you to do what the Basic and Standard do,
plus the ability to do advance data analysis and modeling, which we will
not require in this book. You can take a look at the differences in details at
http://bit.ly/b04847_agslicenses.
In this book, the first two examples only require the Basic license. However, the
third example requires the Standard license to fully implement it. Esri provides
the Standard license for 60 days, which you can get by creating an account at
http://www.esri.com/.

The system requirements of ArcGIS for


Desktop
The latest out-of-the-box ArcGIS for Desktop can be downloaded from the official Esri
website at http://bit.ly/b04748_agsfree. However, if you want to customize, in
the same way we will be doing in this book, you should officially request the media
disc from your local Esri distributor that will have the ArcObjects SDK.
ArcObjects is a software development kit by ArcGIS that can be used
by software developers to extend the ArcGIS functionality.

ArcGIS for Desktop requires the .NET Framework 3.5 service pack 1 and Microsoft
Internet Explorer 9.0 or higher in order to run. The .NET Framework can be
downloaded from http://bit.ly/b04748_dotnet35. Some operating systems,
such as Windows Server can be configured to enable the .NET Framework,
instructions to do that can be found in the same link. The system requirements for
running ArcGIS for Desktop as of version 10.3 and full details on the system and
hardware requirements can be found at http://bit.ly/b04748_ags103sysreq.

[3]

Getting Started with ArcGIS

In this book, I will be using Microsoft Windows 8.1 Pro with ArcGIS for Desktop
10.3. Feel free to use any version of Desktop (10 or higher) with the supported
version of Windows as per the system requirements in the following table:
Product
Version

Supported OS

Reference

ArcGIS 10.3

Windows 7, 8, 8.1, Server 2008, Server


2008R2, Server 2012, Server 2012R2

http://bit.ly/
b04748_ags103sysreq

ArcGIS 10.2.x

Windows XP, Vista, 7, 8, 8.1, Server 2003,


Server 2008, Server 2008R2, Server 2012,
Server 2012R2

http://bit.ly/
b04748_ags102sysreq

ArcGIS 10.1

Windows XP, Vista, 7, 8, Server 2003,


Server 2008, Server 2008R2, Server 2012

http://bit.ly/
b04748_ags101sysreq

ArcGIS 10.0

Windows XP, Vista, 7, Server 2003,


Server 2008, Server 2008R2

http://bit.ly/
b04748_ags10sysreq

ArcGIS 9.3.x

Windows XP, Vista, 7, Server 2003,


Server 2008, Server 2008R2

http://bit.ly/
b04748_ags93sysreq

ArcGIS 9.2.x

Windows XP, Vista, Server 2000, Server


2003

http://bit.ly/
b04748_ags92sysreq

The examples in this book can also be applied to older versions of ArcGIS (10.0, 10.1,
10.2.x). I will be providing designated copies of the data and map documents for
each version so that you can freely work with the version of ArcGIS you prefer.
ArcGIS versions prior to 10 won't be able to take advantage of the new
add-in feature.

The important concepts of ArcGIS for Desktop


Before we dive into customizing ArcGIS, it is important to know some key concepts
and definitions. We will start with the geodatabase.

The ArcGIS geodatabase


The database is a fascinating storage system. It allows you to retrieve, store, and edit
the different types of information such as text, images, music, and videos. However,
for people who work with maps, we feel there is a missing element in that compound,
that is, location. Adding location information to database helps applications bring life
to the tabular records in the database and make it available visually. Esri has done this
in its ArcGIS product and called this special location-based database a geodatabase.
[4]

Chapter 1

The ArcGIS geodatabase is the proprietary database for Esri. All Esri
geospatial software is built around this geodatabase.

Adding location information to a database requires two parameters: the actual


location coordinates and how these coordinates are supposed to be drawn, which
is also known as the spatial reference. The spatial reference describes whether the
location is projected on to a two- or three-dimensional map, and it should be defined
for every dataset in the geodatabase that has a spatial component. While working in
ArcMap, all datasets should share the same spatial reference.
A spatial reference is a collection of properties that describes
the system for locating a particular object in a coordinate
system. You can find more information about this topic at
http://bit.ly/b04748_spatialref.

There are a lot of spatial references tailored for different locations on the earth. There
are some standard references used universally, and among them is the WGS 84,
which we will be continuously using in this book.
Let us start using the software and get familiar with geodatabase components. Make
sure you have installed ArcGIS for Desktop and then follow these steps:
1. First of all, we want a geodatabase to work with. Create a new folder in your
root drive c:\ArcGISByExample\. In the supporting files for this chapter,
copy the B04847_01_Files folder to the C:\ArcGISbyExample folder.
2. From the Start menu, locate and run ArcCatalog 10.3 (or your version of
ArcCatalog). It is the one with the cabinet icon.
You can dock and pin ArcCatalog in your start menu to access it
quickly.

3. From the Catalog Tree window, right-click on Folder Connections and click
on Connect To Folder. This will establish a connection with the folder that
contains the geodatabase.

[5]

Getting Started with ArcGIS

4. From the Connect To Folder dialog, browse and select the


C:\ArcGISbyExample folder and click on OK, as illustrated in the
next screenshot. Note that if you don't see the Catalog Tree window,
you can show it from the Windows menu in the toolbar.

5. You should see that the C:\ArcGISbyExample folder has been


added to the Folder Connections folder. Use this folder to browse to

C:\ArcGISByExample\B04847_01_Files\Geodatabase\Restaurants.gdb,

as shown in the following screenshot:

[6]

Chapter 1

6. Make sure that the Content tab is active. You should see the different objects
that this geodatabase consists of. The first object is Food_and_Drinks, which
is the feature class of some restaurants. The Food_and_Drinks object has a
one-to-many relationship with VENUES_REVIEW which stores the reviews of a
given restaurant.
The feature class is one of the basic objects in a geodatabase. This object
is a table with a shape attribute that defines the location and geometry.
It could be a point, line, or a polygon.

7. You can view the content of the feature class by selecting it and clicking
on Preview, as shown in the following screenshot. The default preview is
Geography, which visually displays the points:

[7]

Getting Started with ArcGIS

8. You can also display a tabular view by changing the Preview type to Table,
as illustrated in the following screenshot:

9. Go back to the Contents tab, from Catalog Tree, right-click on the


Food_and_Drinks feature class and select Properties.
10. Activate the General tab and take a look at Alias Name, we can freely change
this name without actually changing the physical feature class name for
convenience reasons. The current Alias Name Food and Drinks Venues in
Belize is quite long, so let us change it to Venues only. Click on Apply to
save your changes.
11. Activate the Fields tab, which is the columns or attributes that this feature
class consists of. Take note of the different data types for each field. Pay
attention to the SHAPE field, which is created by default and the data
type is Geometry.

[8]

Chapter 1

12. Activate the Subtypes tab; here we can define multiple types for our feature
class. In our case, we have five different restaurant types number coded.
13. Click on OK to close the feature class properties.
14. Close ArcCatalog.

Working with the map layers


Now that we have worked with ArcCatalog and learned about the basics of the
geodatabase, it is time to learn about the map:
1. From the Start menu, locate and run ArcMap 10.3 (or your version of
ArcMap). It is the one with the map and lens icon.
2. If you are opening ArcMap for the first time, you will be prompted with the
getting started dialog. Click on Cancel to work on the default document.
3. We want to work with our geodatabase on ArcMap. To do that, we need to
add a feature class to the map.
4. From the Table of Content window, right-click on the Layers node and click
on Add Data. This will open a dialog to select a geodatabase.
5. Since we established a folder in ArcCatalog, you should see it in Folder
Connection under the Look In dropdown.
6. Browse to the Restaurants.gdb geodatabase, select the Food_and_
Drinks feature class, and then click on Add, as illustrated in the following
screenshot:

[9]

Getting Started with ArcGIS

7. You will see that a new layer has been created under layers named Venues.
This is the representation of the feature class. You can see that the name of
the layer is actually the alias name of the feature class by default, which we
have renamed in the The ArcGIS geodatabase section. ArcMap creates this
layer wrapper to visual a feature class, change symbology, control labels,
scaling, and so many other things.
A layer is an ArcMap object and a visual representation of a physical
feature class. A layer does not exist by itself and needs a source dataset
to read data from.
A symbology is a notation for the features in a feature class. A given
feature class might have multiple symbologies based on its attributes.

8. Note that different symbologies have been assigned based on the restaurant
subtypes that we have mentioned in the The ArcGIS geodatabase section. See
the following screenshot:

9. We can change the symbology to make it more relevant; click on the point
next to Bar to change its symbol. This will bring up the Symbol Selector.
Type Bar in the search box and hit Enter. Select your favorite symbol and
click on OK, as shown in the next screenshot:
[ 10 ]

Chapter 1

10. You should see that the map has been refreshed with the new symbology, as
shown in the next screenshot. You can see how rich you can make your map
by using these built-in tools. Imagine what we can do if we could extend this
to the next level, as we will see in the next chapter.

11. Close ArcMap and choose not to save your changes.


[ 11 ]

Getting Started with ArcGIS

Customizing ArcGIS for Desktop


In this section, we will discuss the benefits of customizing ArcGIS. When a particular
requirement or feature is not available in ArcGIS, we can actually extend the ArcGIS
functionality to do that for us. In this book, we will explain two different approaches
for deploying ArcGIS customization respectively: add-ins and extending ArcObjects.
You will need the ArcObjects SDK to start the development. There are many other
ways for customizing ArcGIS, including user interface customization using Visual
Basic for Applications (VBA), modeling and scripting using Python, and building
standalone applications using ArcGIS Engine. In this book, we will use the add-ins
and extending ArcObjects method.
ArcGIS add-ins is a building approach where the developer
customizations are categorized and controlled by ArcGIS. Add-ins can be
disabled and enabled by the user of ArcGIS at any given time.

ArcGIS for Desktop comes with great set of built-in tools that can help you solve
interesting mapping problems. However, there comes a time where your problem is a
complex one. This is where you might need to extend and customize the functionality
of ArcGIS to provide a suitable solution to your problem. The examples in this
book require customizations to tackle them. In this section, we discuss the different
customization approaches to set up our development environment. Another reason
to extend ArcGIS, for example, a certain functionality, might be available in ArcGIS,
but you need to perform 10 or 15 steps to achieve it, and customizing the product can
group and automate these steps so that you can default all of them in a few clicks.
The first attempted approach to providing customization for ArcGIS was through
VBA. This is similar to the macroscripts in Microsoft Word and Excel. You could
write an application and save it in the map document and later share this document,
and the person running your document could use your application. It was a
convenient approach for sharing mapping, but with many problems. The main
problem was the security. The document might contain malicious code that would
execute with user privileges and can potentially harm the user. That is why this
approach was discouraged and has been replaced with ArcGIS add-ins and the
extensions building approach. Today, you can still develop using VBA by installing
the VBA compatibility setup.
Customizing ArcGIS for Desktop requires that you either build add-ins or use the
classical Dynamic Link Library (DLL) approach and register it with ArcGIS for it to
work. Both approaches use ArcObjects as the underlying technology, however, the
final building technique is different.
These built approaches are not share-friendly, however, Esri came up with a
beautiful solution and platform for sharing, and that is ArcGIS Online. That
discussion though should be an entirely different book.
[ 12 ]

Chapter 1

The system requirements of ArcObjects


In order to customize ArcGIS for Desktop, we will require installing some more
components. Microsoft Visual Studio, which will be our Integrated Development
Environment (IDE). This is where we will be writing code in .NET to customize
ArcGIS.
The second component that we will also need to install is ArcObjects SDK for .NET,
which will add the software development kit and Visual Studio plugins to write
Desktop applications.
IDE is a software that allows computer programmers to write code in
order to develop software. The IDE usually consists of a source code
editor, syntax highlighter, compiler, builder, and a debugger, which
help the programmer in the software development process.
It is important to install ArcObjects SDK after completely installing
Visual Studio so that ArcObjects will be able to install plugins on top of
the Visual Studio IDE.

In this book, we will be using Microsoft Visual Studio 2013 Express for Windows
Desktop as our IDE. The software can be downloaded for free from the official
Microsoft website at http://bit.ly/b04748_vs2013exp. This is quite a big
download and it will take some time depending on your Internet connection. When
you install ArcObjects SDK, the setup will detect your current Visual Studio and
install the plugins accordingly, as shown in the following screenshot:

[ 13 ]

Getting Started with ArcGIS

You can also use Visual Studio 2012 with ArcObjects SDK 10.3. Just make sure
to install the Visual Studio before you install the ArcObjects SDK for .NET.
For a complete list of system requirements for ArcObjects SDK 10.3, follow
http://bit.ly/b04748_ao103sysreq.
If you are programming under different system configurations, take a look at the
following table to make sure you comply with the system requirement:
Product version

Supported IDE

Reference

ArcObjects SDK 10.3

VS2013, VS2012

http://bit.ly/b04748_ao103sysreq

ArcObjects SDK 10.2.x

VS2012, VS2010

http://bit.ly/b04748_ao102sysreq

ArcObjects SDK 10.1

VS2010

http://bit.ly/b04748_ao101sysreq

ArcObjects SDK 10.0

VS2008, VS2010

http://bit.ly/b04748_ao10sysreq

ArcObjects SDK 9.3.x

VS2008, VS2010

N/A

ArcObjects SDK 9.2.x

VS2005, VS2008

N/A

I couldn't find official online references to support my claims for 9.3.x and 9.2.x, but
from a personal experience, I did use ArcObjects with 2005 and 2008 on both the 9.2
and 9.3 systems and it was working flawlessly.

Verifying the installation of ArcObjects


In this section, we will validate the ArcObjects SDK installations and Visual Studio.
To make sure that you have installed ArcObjects SDK correctly, follow these steps:
1. From the start menu, locate and run VS Express 2013 for Desktop. If you are
using a different version of Visual Studio, refer to the system requirements
section to make sure your version complies with ArcGIS.
2. From the Visual Studio application, click on the File menu and then select
New Project.
3. From the New Project dialog, expand the Templates node, and then
expand Visual Basic. This is the language we will be using in this book;
you can freely use C# if you would like. If you have installed ArcObjects
SDK successfully, you should see the ArcGIS node where we have all
the different approaches for customizing ArcGIS. This is illustrated in the
following screenshot:

[ 14 ]

Chapter 1

4. Close Visual Studio.

App 1 the cell tower analysis tool


In this section, we introduce the first example that we will work on. A telecom
company wants to measure their user experience when it comes to cell phone signal
reception. The tool you will write will help the company decide whether to add more
towers, relocate, or upgrade existing towers to provide maximum signal coverage so
that users can experience uninterrupted reception while using their cell phone.
TelZaViBa is a telecom company that provides cell service for their customers.
Recently, some customers have been experiencing a weak signal on the Boulevard du
Montparnasse. To analyze the situation, TelZaViBa had to analyze their cell towers
in that area. So they asked us to write a tool on ArcGIS for Desktop that simulates
a person with a cell phone walking in the Boulevard du Montparnasse. The tool
should show the current signal strength at all time and record the weakest signal
spots by highlighting it on the map.

[ 15 ]

Getting Started with ArcGIS

TelZaViBA gave us a geodatabase with all their cell tower information on the
Boulevard du Montparnasse. Based on the tool's result, the telecom company can
then do what will be necessary, such as installing a stronger tower with a higher
range in the weak spot or relocating existing towers wherever it is feasible and
economical. What we have here is a geodatabase with information, and we need to
take this information to the next level by analyzing it.
This application will span into three chapters. Since this is the first example, we
will spend some time in Chapter 2, App 1 the Cell Tower Analysis Tool, to get you
familiar with ArcGIS add-ins and the ArcObjects interfaces before we dive into the
development. We will prepare the ground by talking about layers, feature classes,
features, and geometry. We will then learn how to do some topological operations
on the geometry to draw the signal range buffer. Then we will draw the signal range
based on the radius value that is stored as an attribute in the tower feature class.
In Chapter 3, Mapping Signal Strength, we map the tower's signal strength, which
is basically how many bars a particular cell phone has when it is in range of a cell
tower. We will measure the signal strength in percentages for simplicity and then we
will convert it to bars. To do all that, we first need to add a point to the map and then
find a distance between that point and one of the towers using the proximity tools in
ArcGIS. We will then use this knowledge to find and highlight the closest tower to
the point we just drew. Finally, we will display the signal strength on the point using
ArcGIS graphics.
In Chapter 4, Real-time Maneuvering, we do the real-time maneuvering and things get
interesting. We will simulate a person walking along the boulevard with a cell phone
and then use the logic we wrote in Chapter 3, Mapping Signal Strength, to establish the
signal strength and the closest tower. We will simulate this by reading the previously
recorded text file Global Positioning System (GPS) points and load them into our
tool. With each step the signal will get updated with the new value based on our
signal calculation algorithm. The active connected tower will be blinking on the map
along with the cell phone.
GPS provides the location and time information using satellites on the
earth. Nearly all new smart phones are equipped with GPS receivers
that can identify the device's location with respect to the earth.

TelZaViBa can use this tool to simulate cell phones and monitor the signal strength
on the boulevard and find the weak signal spots.

[ 16 ]

Chapter 1

This example is not an actual project and is not related to any


country whatsoever. All data, maps, and ideas in this example are
my sole creation and have not been copied or repurposed from other
resources.

App 2 the restaurant mapping


application
This is the second example that features a restaurant mapping application where
you will build an application on top of ArcGIS for Desktop that allows users to view,
search, highlight restaurants on the map, and compare their ratings and reviews.
Belize is thriving with tourism. Lots of tourists go there on holidays to enjoy its
beautiful beaches and a wide range of restaurants. The government of Belize is trying
to enrich the tourists' experience by finding their favorite restaurants in the country
more effectively.
To accomplish that, a new project titled Bestaurants has been proposed to design a
restaurant mapping application on top of ArcGIS for Desktop to feature the best
restaurants in Belize. The application will contain a map that shows the city of Belize
and the restaurants with key icons based on the restaurant type. For example, a caf
will be shown as a coffee mug and a restaurant will be displayed as a fork and a knife.
Users should be able to search for restaurants by name, region, category, or rating.
Using the Bestaurants geodatabase, we will build this application from scratch to
satisfy these requirements. In Chapter 5, App 2 Extending ArcObjects, we start off
by learning a bit about a different deployment approach with ArcObjects. We learn
about building our first toolbar on ArcMap and add a button to it. We will learn how
to query the subtypes that we have mentioned in the ArcGIS geodatabase section
and populate them in a form. We will then filter the restaurants based on a selected
subtype. We will kick off Chapter 6, Reviews and Ratings, by talking about relationships
and then use this knowledge to learn how to query relationship classes in ArcObjects.
This will be useful to retrieve ratings and reviews since these are related information
that is located in another table. We will also learn how to filter the layer to show
searched results. Finally, in Chapter 7, Advanced Searching, we include the region feature
class and use the intersect tool to find all restaurants within a region and populate
them in the form. We will also show how to add a text box to our toolbar and add
search functionality to search for results as we type in the text box. This will make it
easy for users to simply type the name or even part of the name of the restaurant and
show it on the map.

[ 17 ]

Getting Started with ArcGIS

This example is not an actual project and is not related to any


country whatsoever. All data, maps, and ideas in this example are
my sole creation and have not been copied or repurposed from other
resources.

App 3 the excavation planning manager


The excavation planning manager is a tool that we will be writing to help
construction designers plan their excavation for utilities and telecom networks. The
application analyzes the underlying soil type and green area to find out the cost of
removing these areas by doing extensive spatial analysis and editing. Note that we
will require the Standard license for this example.
When utility and telecom companies want to lay out their underground assets,
cables, and pipes, they need to excavate the ground first. This is a challenging task
since there are different types of soil and each has special kind of machinery and
equipment, and, therefore, cost.
YharanamCo is a construction contractor experienced in executing efficient and
economical excavations for utility and telecom companies. When YharanamCo's
board of directors heard of ArcGIS technology, they wanted to use their expertise
with the power of ArcGIS to come up with a solution that could help them cut costs
even more. Soil type is not the only factor in excavation; there are many factors
including the green factor, where you need to preserve the trees and green area
while excavating for visual appealing. Using ArcGIS, YharanamCo can determine
the soil type and green factor and calculate the cost of an excavation.
The excavation planning manager is the application you will be writing on top
of ArcGIS. This application will help YharanamCo create multiple designs and
scenarios for a given excavation. This way they can compare the cost for each one
and how many trees they could save by going through another excavation route.
YharanamCo has provided us with the geodatabase of the soil and trees data for one
of their new projects for our development.
In Chapter 8, App 3 Advanced ArcObjects, since we will create excavations on
the map, we will learn the geodatabase editing. We will then add a tool to
draw polygons using ArcObjects drawing tools. Then we will view and edit the
excavations that we created.

[ 18 ]

Chapter 1

In Chapter 9, Excavation Cost Calculation, the actual advanced spatial analysis and cost
estimation happens. We will write this cost calculation module that uses the soil and
trees layers and excavation. This is why we require the Standard license to perform
such advanced spatial analysis.
In Chapter 10, Saving and Retrieving Excavation Designs, we will propel our application.
We will group multiple excavations into a design. We will then allow the user to
create multiple designs. The user can open, close, edit, compare, and delete designs.
Each design will be a dedicated geodatabase; therefore, we will be making copies
and dealing with multiple geodatabases at once. It will be a great experience.

Summary
In this chapter, you learned about the different components of ArcGIS for Desktop,
ArcMap, and ArcCatalog. You used ArcCatalog to learn more about ArcGIS like
geodatabase, spatial references, and feature classes. You also used ArcMap to add
a layer and change its symbology. After paving the way with these ArcGIS basic
concepts, you were briefly introduced to the three examples that you will be working
on through the course of this book. The first example talked about the basic spatial
customization. The second one taught you intermediate skills for working with
the geodatabase. The last example featured advanced geodatabase and mapping
techniques that combined will set you up to take your ArcGIS development skills to
the next level.
In the next chapter, you will learn how to develop using ArcGIS add-in for your first
example, the TelZaViBa cell tower analysis tool.

[ 19 ]

Get more information ArcGIS By Example

Where to buy this book


You can buy ArcGIS By Example from the Packt Publishing website.
Alternatively, you can buy the book from Amazon, BN.com, Computer Manuals and most internet
book retailers.
Click here for ordering and shipping details.

www.PacktPub.com

Stay Connected:

You might also like