Home Programming Learning ArcGIS Geodatabases

Learning ArcGIS Geodatabases

By Hussein Nasser
books-svg-icon Book
eBook $18.99 $12.99
Print $28.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $18.99 $12.99
Print $28.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
About this book
Publication date:
June 2014
Publisher
Packt
Pages
158
ISBN
9781783988648

 

Chapter 1. Authoring Geodatabases

For a very long time, mankind recorded historical events in the form of drawings, inscriptions, and books. Books were organized into physical volumes, and volumes were arranged by their topic on shelves in a library. This system worked very well for centuries. We can place as many books as the shelf space can handle. With the information age and the invention of the byte, data is stored and retrieved electronically. It started with simple sequential text files. As more complex structures were introduced, we started depending on computers to store our data. This required a completely new system to structure, organize, and manage the digital data. For this, a system by which computers can efficiently browse and retrieve stored information was required, which led to the invention of the database.

Note

A database is an organized collection of related data that's designed for efficient storage and retrieval. In this system, data is stored in a series of relations called tables. Each table contains a set of related data, where a row contains one instance of data and a column contains information that describes that instance.

Many database management systems (DBMS) have been introduced over the years. They have all been designed to organize digital information. When networking came into the picture, DBMSs evolved; now, multiple users can read the same piece of information from different locations (or from different continents). They can update the same table; therefore, the multiediting environment, database replications, and other niche technologies spawned from this field.

Note

DBMS is a software that allows multiple users to interact with a database. They come either in the client-server model or the file-based model. These may include the server, which manages the database and listens for incoming client connections, and the client, which connects to the server.

After that short tour of the evolution of databases, we need to focus on the topic of this book. A database is a fascinating storage system. It allows you to retrieve, store, and edit different types of information such as text, images, music, and videos. However, for people like us who work with maps, we feel there is a missing element in that compound, that is, location. Adding location information to a database helps applications bring life to the tabular records in the database and make it available visually. For instance, you can add x and y columns to a Restaurant table in a database, which represents the coordinate's location of each restaurant in the table. Then, you can write a custom application to read the coordinates and display the restaurants in a map. Esri realized the importance of injecting location information into a database, and created its own standard location-based database; you guessed it, the ArcGIS geodatabase. An ArcGIS geodatabase offers you a generous number of geographically enabled objects called datasets.

Note

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

In this chapter, you will work on a real-life business case study where you will learn how to create your first ArcGIS geodatabase and add different datasets using ArcGIS for Desktop, hereafter known simply as Desktop (uppercase). To start with this chapter, make sure you have a machine with Desktop 10 or higher. You can work with a 9.2.x or 9.3.x Version of Desktop since the underlying geodatabase is the same; however, you might be missing some features that are required to perform the exercises of the book. I will be using Version 10.2; you can download the latest version of ArcGIS for Desktop for free with a 60 day trial from the Esri website at http://www.esri.com/software/arcgis/arcgis-for-desktop/free-trial. You will need at least a standard or an advanced license, which will allow you to edit.

Note

The ArcGIS geodatabases authored in 9.2 and 9.3.x can be viewed and edited in ArcGIS 10.x. However, it is recommended that you use 10.x geodatabases during the course of this book to maintain a consistent flow and error free exercises.

 

Bestaurants, the best restaurants in Belize


Belize thrives on tourism. Lots of tourists go there on holiday to enjoy its beautiful beaches and a wide range of restaurants. The government of Belize is trying to enrich tourists' experience by helping them to find their favorite restaurants in the country more effectively. To accomplish that, a new project titled Bestaurants has been proposed to design a new geodatabase which will have all places to eat and drink in Belize. Using ArcGIS for Desktop, we will design and create an ArcGIS geodatabase that can accommodate all diners, cafes, restaurants, bars, and lounges in Belize. You should be able to use Desktop to populate the geodatabase and add new venues in the Bestaurants geodatabase.

Note

This project is an example that will be used and will reappear in later chapters. It is not an actual project and is not related to the country whatsoever.

 

Designing the geodatabase schema


Before we start creating the geodatabase, we need to design a template that includes the tables, fields, and data types for the Bestaurants project. This template is called the geodatabase schema.

Note

A schema is a metadata template that describes the tables, fields, and field types in a particular database.

So, let's design the logical schema for the Bestaurants project. We will start with a very simple design where we create the basic atom dataset in the geodatabase, the feature class.

Note

The feature class is one of the basic objects in a geodatabase. This object class is a table with a shape attribute, which could be a point, line, or a polygon.

According to the case study, we need to create a geodatabase that accommodates diners, cafes, restaurants, bars, and lounges. So, we can create each one of them in a separate feature class, and then we need to give appropriate fields for each feature class. Take a few moments to answer these questions: what feature classes will you include in the geodatabase? What attributes will you use for each class? What are the data types for these attributes? Take a look at the following table:

Feature class

Field

Field type

Diners

NAME

Text

WEBSITE

Text

RATING

Short Integer

SHAPE

Geometry

Cafes

NAME

Text

WEBSITE

Text

RATING

Short Integer

SHAPE

Geometry

Restaurants

NAME

Text

WEBSITE

Text

CUISINE

Text

RATING

Short Integer

SHAPE

Geometry

Bars_and_Lounges

NAME

Text

WEBSITE

Text

RATING

Short Integer

SHAPE

Geometry

There are a lot of ways to design the schema for a geodatabase. There are really good ways that keep your geodatabase healthy in the long run, and there are bad ways that are inefficient. This design is a simple one; it is not the ultimate, and you might come up with a better design. The only reason I selected this is for its simplicity, and there is definitely plenty of room for improvement. You will learn how to create an efficient schema design in Chapter 3, Modeling Geodatabases, as you are introduced to more geodatabase datasets.

As you can see, we have merged the bars and lounges into one single feature class. We have used point geometry to represent these feature classes since it is easier to sketch, which could be identified with a Global Positioning System (GPS) device. These feature classes are also fast to draw, and we don't really care about the boundaries. However, it all depends on your requirements; whether it is necessary to identify the boundary of a certain feature or not. You may use polygon geometry if you want to.

Note

GPS is a space-based satellite navigation system that provides location and time information, whereas a feature is a single record or object in a feature class which has a set of attributes and geometric shapes.

 

Creating the geodatabase


After we have designed the geodatabase schema, it is now time to author the geodatabase. In this section, we will use ArcCatalog to create the geodatabase. ArcCatalog is an application that allows us to author geodatabases, browse through them, add/delete datasets from geodatabases, and so on. To create your first geodatabase, perform the following steps:

  1. Open ArcCatalog; you can find it in the Start menu under the ArcGIS folder, as explained in this chapter. The following screenshot illustrates this:

  2. Once you start the application, make sure you see the Catalog Tree window. This is the folder view of your computer, and this is where we will be doing most of the work.

  3. To show the Catalog Tree window, point the cursor to the Windows menu and then click on Catalog Tree.

  4. Next, you need to specify the folder where you will create your Bestaurants geodatabase.

  5. Using Windows Explorer, create a folder named c:\gdb. This is where the geodatabase will go.

  6. From the Catalog Tree window, right-click on the Folder Connections node and click on Connect to Folder…. This feature allows you to connect to your Windows folder.

  7. Browse to the new folder you just created, c:\gdb, and then click on OK.

  8. Select the folder and then right-click on the empty view to the right, point the cursor to New, then click on File Geodatabase, as shown in the following screenshot:

This will create a file geodatabase in the specified folder with a default name of New File Geodatabase.gdb; rename the new geodatabase to Bestaurants. The gdb extension is automatically appended.

Note

A file geodatabase is the proprietary geodatabase for Esri, structured as a folder with many files that can only be viewed and opened by Esri products or applications which support the file geodatabase API. This has an extension of gdb.

The spatial reference

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 a two- or three-dimensional map, and whether 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.

Note

A spatial reference is a collection of properties that describe the system to locate a particular object in a coordinate system. You can find more information about this topic at http://bit.ly/lag_spatialreference.

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.

Creating the feature classes

In the previous section, we designed the logical schema for our geodatabase. We will now create the actual datasets, or the physical schema. First, we start by creating the feature classes as follows:

  1. Open ArcCatalog and browse to your Bestaurants geodatabase in the Catalog Tree window.

  2. Click on the Bestaurants file geodatabase, right-click on the empty right panel, point the cursor to New, and then click on Feature Class…, as shown in the following screenshot:

    This will open up the New Feature Class dialog where you specify the basic properties of the feature class. In the Name field, type Diners. This is the physical name of the feature class in the geodatabase, and it should not contain special characters and should not include any spaces.

  3. Type Belize Diners in the Alias field. This is a description of the feature class's name. It can be anything you want. When you add a new layer, it takes this alias name by default.

  4. In the Type drop-down list, select Point Features to create the feature class with point geometry.

    The Geometry Properties section offers advanced options to enable the feature class. This includes the M value that helps in the route information for linear features and the Z value that is used for 3D representation, which enables the elevation and extrusion of features. The Z value can be useful, for example, if a restaurant is located on the 11th floor of the Ritz Carlton hotel.

    Note

    Besides X and Y coordinates, the M value can be added to each vertex on a line to provide more information, such as the direction.

    Unlike X and Y coordinates, the Z value can be considered as the height of a feature upward or downwards. This value can be assigned to features so they are represented in a 3D plane.

  5. Since we don't need to store route or 3D data at this stage, leave the M and Z values unchecked. Click on Next. This is illustrated in the following screenshot:

    In the next dialog box, you will set the spatial reference for our new feature class. You will use the WGS_1984_Web_Mercator standard spatial reference, which is also used by Google Maps.

  6. In the spatial reference drop-down list, select WGS_1984_Web_Mercator and press Enter to find its item.

  7. Expand the Projected Coordinate Systems node, then expand the World node, and then click on the WGS 1984 Web_Mercator (auxiliary sphere) node, as illustrated in the following screenshot.

  8. Click on Next to move to the next form.

    Next, we set the XY Tolerance value for the feature class. As you start adding features, you might want to add some features close to each other, but you don't want them to snap into the same position. In this case, make this value smaller to get a higher accuracy for each feature position. However, sometimes, you will need to add features on top of each other, making them overlap on purpose, especially if you have Z values. Too small a tolerance value might make it difficult to snap these features into a single location and might cause problems with shared boundaries.

  9. As you can see, this value needs to be carefully planned, but for now, leave the XY Tolerance value to its default value, which is 0.001 meters, and click on Next.

    Note

    The XY Tolerance value is the minimum distance after which two features will snap together.

In the next form, we select the configuration keyword; choose the Default configuration keyword and click on Next.

Note

The configuration keyword is a table space in which feature classes and tables are stored. Each configuration has certain properties, such as the geometry type and file size, which are shared by all objects in that keyword.

Finally, we add the fields for our feature class. Note that two fields are already added for you. The first field is OBJECTID, which is also the primary key; a sequence number that represents each feature in the feature class uniquely.

Note

The primary key is a column by which a record is uniquely identified in a table or a dataset.

The second field is SHAPE, which if you remember, we have added by specifying the geometry type. So, we need to add three more fields: NAME, WEBSITE, and RATING; click on an empty row in the Field Name column and add the following fields:

Name

Data Type

NAME

Text

WEBSITE

Text

RATING

Short Integer

After adding all the fields, your dialog box should look like the following screenshot; click on Finish to create the feature class:

You just created your first feature class; if you take a look at the icon, you will see three small dots, which indicates that this feature class has a point geometry.

Using the same approach, create the rest of the feature classes, Cafes, Restaurants, and Bars_and_Lounges, in your geodatabase based on the schema we designed earlier.

Note

If you are creating multiple feature classes with similar fields, use the Import... feature in the fields' page to import the fields from an existing feature class. This could prove efficient when you are authoring your geodatabase.

After creating all the feature classes, your final geodatabase should look like the following screenshot:

 

Editing the geodatabase in ArcMap


We have authored our Bestaurants geodatabase and created the food and drinks venues' feature classes. However, these classes are empty, and until they have some features, we can't visualize them; it is time to populate them with features. To do that, we need an editing tool, and ArcMap can help with this. However, before we can start editing our geodatabase, we need to know where we can add these features. We can't just place them anywhere in the world. We need a reference to base our editing on, Basemap. I have already prepared a map document and saved it to the extent of Belize. You can find it in the supporting files for this chapter, 8648OT_01_Files, which can be downloaded from www.packtpub.com.

Note

Basemap is a background map that usually references imagery and land information.

Browse to 8648OT_01_Files\MapDocuments and open the Belize_BaseMap.mxd file; this will open ArcMap. You will need an Internet connection for this exercise since the document connects to an online basemap. We will start by adding the Restaurants feature class. To do this, perform the following steps:

  1. From the ArcMap menu, point the cursor to File, then Add Data, and click on Add Data....

  2. From the Add Data dialog box, expand the Look in drop-down list and select the Bestaurants geodatabase in c:\gdb.

  3. Double-click on the Restaurants feature class to add it to ArcMap, as shown in the following screenshot:

Notice that a new layer is added with the alias name of the feature class that we specified while creating it. Also, a default red point is added as a symbology for our feature class. Let's change it to a more relevant symbol by performing the following steps:

Note

A layer is an ArcMap object and a visual representation of a physical feature class. A layer does not exist by itself and must have 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.

  1. Double-click on the Belize Restaurants layer to view the Layer Properties dialog box.

  2. Click on the Symbology tab.

  3. In the Symbol section, click on the red dot and select a restaurant icon; type Restaurant in the filter box. The dialog box will look like the following screenshot:

  4. Close the Layer Properties dialog.

Now, it is time to add some features. Before we do so, make sure that you close ArcCatalog and that you do not have any connections to your geodatabase. Now, to display the Editor toolbar, perform the following steps:

  1. Right-click on an empty area in the menu and select the Editor toolbar to activate it.

    Note

    The Editor toolbar will be displayed only if you have standard and advanced licenses. For details, refer to http://www.esri.com/software/arcgis/about/gis-for-me.

  2. On the Editor toolbar, point the cursor to Editor and click on Start Editing.

  3. Click on the Create Features button in the Editor toolbar, and you will see the Create Feature window pop up on the right-hand side.

  4. Click on Belize Restaurant and add some restaurants on the Belize map; you don't have to be accurate at this stage. You should get something like what is shown in the following screenshot:

    You can set the attributes for each feature you add by selecting that feature and clicking on the Attribute tool in the Editor toolbar. You can populate the rest of your geodatabase feature classes by adding the feature classes to the same map.

  5. From the Editor toolbar, point the cursor to Editor and click on Save Edits if you wish to save your edits.

  6. Close ArcMap.

 

Summary


In this chapter, you learned how to design, author, test, and edit a complete geodatabase by following a real-life example. You started with designing the schema of the geodatabase. You also specified the fields, data types, and geometry type for the feature classes. You then created the physical file geodatabase using ArcCatalog, specified the spatial reference, and used the editing tools in ArcMap to populate the geodatabase with features.

In the next chapter, you will enhance the skills acquired in this chapter to do more work with geodatabase datasets.

About the Author
  • Hussein Nasser

    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.

    Browse publications by this author
Latest Reviews (1 reviews total)
Its a good book with a elaborate practical example.
Learning ArcGIS Geodatabases
Unlock this book and the full library FREE for 7 days
Start now