During the course of this book, you have learned about the key tools to author, manage, and administer ArcGIS geodatabases. You have learned how to create a geodatabase, add datasets, create relationships, and much more. In the previous chapter, you learned some techniques that can be applied to the geodatabase to optimize and keep your geodatabase healthy. You might have noticed that running all these tools manually, especially in bulk mode, can be a hectic process. That is why Esri, the company that created ArcGIS, has made all these geodatabase functionalities available as geoprocessing tools. These tools can be combined and joined together to form other tools with different functionalities. They can also be called from various programming platforms such as Python to solve interesting problems, as we will see later in this chapter.
You're reading from Learning ArcGIS Geodatabases
Due to the simplicity of Python, the 23-year-old scripting language has been widely used to build various applications. Python has also been embedded into other products as a way to extend its functionality. ArcGIS is one of these products that adopted Python for this purpose. In this section, we will learn about a basic Python script to call existing geoprocessing tools, and then we will use these scripts to create a small tool that automatically backs up our Bestaurant
geodatabase on a daily basis.
Note
To learn more about advanced Python scripting techniques, you can visit www.Python.org.
You don't have to install Python for the upcoming exercises; if you have ArcGIS for Desktop 10.x, Python 2.7 is installed and configured and ready for use. Let's do some basic warm up exercises on Python before we start on the real work:
Click on the Start menu, expand the ArcGIS folder, expand Python 2.7, and then click on IDLE (Python GUI) to open the Python editor, as shown in the...
Besides Python scripting, the model builder is a nice way to aggregate multiple geoprocessing tools without the need to have programming skills. If you found it difficult to write Python scripts, you can always use the model builder to create interesting models. In this section, we will use the model builder to build a sample model to create a file geodatabase and a feature class.
You can create a model from either ArcMap or ArcCatalog. To create a model, perform the following steps:
Create a folder in the
c:\gdb
folder and name itmyTools
.Open ArcCatalog, point the cursor to the Geoprocessing menu, and then click on ModelBuilder.
Bring up the ArcToolbox window as well since we will use both. Keep both windows next to each other.
In the ArcToolbox window, expand Data Management Tools and Workspace, and then drag the Create File GDB tool to the Model window as illustrated in the following screenshot:
The...
In this chapter, we discussed some programming flavors. You perceived working with geodatabases from a completely different angle. The chapter demonstrates two methods for programming geodatabases, Python and model builder. Python took the lion's share in this chapter; at first, you learned how to work with basic Python scripting. Then, you were introduced to the arcpy
module built by Esri, which allows Python to tap into the power of ArcGIS and do much more. You dove deep into Python by solving a real-world problem from the ground up using Python. Then, you learned about the model builder and how you can combine and mash up multiple geoprocessing tools to create more sophisticated tools. Unlike Python, the model builder requires no programming skills to work on, which makes it desirable for many users.
In the next chapter, we will discuss how to install, configure, and administer an enterprise geodatabase with Microsoft SQL Server Express from scratch. Enterprise geodatabases are...