Book Image

Learning ArcGIS Geodatabases

By : Hussein Nasser
Book Image

Learning ArcGIS Geodatabases

By: Hussein Nasser

Overview of this book

Table of Contents (13 chapters)

Preface

When the publisher asked me to write a book about ArcGIS geodatabases, I was glad to do so. I have been working with geodatabases since 2005 with eight different versions of ArcGIS starting from Version 9.1; writing this title was a thrill for me. When the publisher mentioned that they need it to be a short book, based on the research done by their strategy team, I had to put in an extra effort and make tough decisions on what to include in this book and what to discard, without compromising on the quality of the content. What you are holding in your hands now is the essence of that work.

Learning ArcGIS Geodatabases was designed for those who want to start using the ArcGIS technology or those who have been using it and want to learn more about geodatabases. There are going to be three themes that will run throughout the book. The first theme covers Chapter 1, Authoring Geodatabases, and Chapter 2, Working with Geodatabase Datasets, and it is tailored for beginners and readers who are not familiar with ArcGIS geodatabases. It teaches readers how to author geodatabases and how to create and work with different datasets in their geodatabase. The second theme covers Chapter 3, Modeling Geodatabases, and Chapter 4, Optimizing Geodatabases, and it is targeted for intermediate users. It caters to those who know about geodatabases already and want to run them better. It is an excellent chapter for those who want to remodel their existing geodatabase and make it more efficient and cost less to maintain. They are also presented with new tools to help them tune and optimize their geodatabase. The last theme covers the last two chapters, Chapters 5, Programming Geodatabases, and Chapter 6, Enterprise Geodatabases, and it is designed for advanced readers. It caters to those who want to excel in using ArcGIS geodatabases with programming and script writing to manage and administer their geodatabase. They want to upgrade and use enterprise geodatabases instead of using simple file geodatabases so they can get the benefits of the multiuser environment.

All three themes come under the umbrella of a project called Bestaurants, where the reader helps a client in Belize, a country on the northeastern coast of Central America. The reader will help improve the Bestaurants project by designing a geodatabase to visualize the best restaurants, diners, cafes, and so on in Belize. With each chapter, the Bestaurants client will ask for new requirements that the reader will try to implement by the end of the chapter. The reader will author the geodatabase, tune, optimize, and create additional datasets, and so much more as the requirements of the client increase.

What this book covers

Chapter 1, Authoring Geodatabases, introduces the concept of geodatabases and how you can design and create one using ArcGIS for Desktop. The chapter discusses a project, Bestaurants, where you need to create a file geodatabase for the restaurants in Belize to help the client visualize them on a map.

Chapter 2, Working with Geodatabase Datasets, will bring in new requirements for the Bestaurants project where you will learn how to create feature classes, tables, and relations between datasets in the geodatabase you created in Chapter 1, Authoring Geodatabases.

Chapter 3, Modeling Geodatabases, will show you some flaws of the design used while creating the geodatabase in Chapter 1, Authoring Geodatabases. It will teach you how to remodel your Bestaurants geodatabase in a more elegant way. It will also show you how to cut down the number of datasets to reduce future maintenance on the geodatabase.

Chapter 4, Optimizing Geodatabases, is where you will be given some new tools to optimize your Bestaurants geodatabase now that it has been modeled elegantly. You will learn concepts such as indexing, compacting, and compressing, which will help you optimize your geodatabase queries and maintain a healthy geodatabase.

Chapter 5, Programming Geodatabases, will take you further along your Bestaurants geodatabase by writing Python scripts against it. It will also teach you how to use a model builder to combine different geodatabase tools to save a lot of time in administering and maintaining your geodatabase.

Chapter 6, Enterprise Geodatabases, introduces the concept of enterprise geodatabases, an upgraded version of a geodatabase that supports multiple user access, enhanced security, and higher availability. It will show you how to set up and configure your enterprise geodatabase from scratch using Microsoft SQL Server Express and migrate your existing Bestaurants geodatabase to the new geodatabase.

What you need for this book

You need Esri ArcGIS for Desktop 10.2.x or 10.1. The book uses ArcGIS 10.2. You can download a trial at http://www.esri.com/software/arcgis/trial or order from your local Esri distributor.

Gliffy is an online modeling tool that can be accessed at http://www.gliffy.com/.

Microsoft SQL Server Express 2012 SP1 can be downloaded for free at http://qr.net/mssqlexpress.

Microsoft .Net Framework 3.5 SP1 can be downloaded for free at http://qr.net/dnfm35sp1.

Who this book is for

Whether you are a student, GIS user, analyst, DBA, system administrator, or programmer with basic or no knowledge of Esri GIS, this book is for you. The book is tailored for students who want to learn about ArcGIS geodatabase. However, down the road in the later chapters, the book helps readers who are looking to improve their existing geodatabases or those who want to use scripting, model builders, or even migrate to enterprise geodatabases.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Using Windows Explorer, create a folder named c:\gdb."

A block of code is set as follows:

import arcpy
import os
import datetime
sgdb_path = "c:/gdb/web"
sgdb_name = "Web_Bestaurants.gdb"
arcpy.CreateFileGDB_management(sgdb_path, sgdb_name)
sfc_source = "c:/gdb/Bestaurants_new.gdb/Food_and_Drinks"
sfc_dest = sgdb_path + "/" + sgdb_name + "/Restaurants"
#Copy features
arcpy.CopyFeatures_management (sfc_source, sfc_dest)
sfield_rating = "RATING"
sfield_desc = "DESCRIPTION"
arcpy.DeleteField_management(sfc_dest, sfield_rating)
arcpy.DeleteField_management(sfc_dest, sfield_desc)
input ("Web Bestaurants geodatabase created successfully, press any key to continue.")

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

import arcpy
import os
import datetime
sgdb_path = "c:/gdb/web"
sgdb_name = "Web_Bestaurants.gdb"
todaydate = str(datetime.date.today().year) + str(datetime.date.today().month)  + str(datetime.date.today().day)
os.rename (sgdb_path + "/" + sgdb_name , sgdb_path + "/" + "Web_Bestaurants" + todaydate + ".gdb")

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "In the Type drop-down list, select Point Features to create the feature class with point geometry."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.