Example: Connect to an ESRI GDB File Geodatabase

In this topic we create a Radian data source by connecting to an ESRI GDB file geodatabase.    The project we create will be used in the Example: Connect Through Radian ODBC to a Third Party and Example: Connect LibreOffice Through Radian to an ESRI GDB example topics.

 

The well-known American GIS company ESRI utilizes several different "geodatabase" formats for data, in three main types:  

 

 

 

 

File geodatabases are recommended by ESRI over personal databases and are becoming one of the most frequent formats used to publish spatial data for use by ESRI applications.   ESRI provides an SDK, used by Radian, to connect to ESRI file geodatabases for read/write access.     The ESRI SDK is not thread-safe, so Radian cannot utilize it for parallel computation, but even with that limitation it provides reasonably fast and reliable connection to ESRI file geodatabases using ESRI's own code.  

 

This topic utilizes a data set published by ESRI.   It illustrates a water distribution network in Naperville, Illinois, in the US.    Like most file geodatabases, the data is published in the form of a .zip file.   When unzipped the example creates a folder called WaterDistributionNetwork.gdb that is populated with over 160 files, the large number of files being characteristic of file geodatabases, which store various different parts of a data set, such as indexes, within separate files.   

 

Visiting the WaterDistributionNetwork.gdb folder in Windows Explorer we see the many files that comprise the data set.   

 

 

eg_esri_gdb01_01.png

 

 

Lucky for us Radian requires no guesswork to connect to the GDB.   We begin by launching Radian.

 

 

eg_esri_gdb01_02.png

 

To connect we choose File - Create - New Data Source.

 

 

eg_esri_gdb01_03.png

 

We enter Water as the name for the data source, choose File: gdb as the Type and then click the [...] Browse button to find and choose the file we will use as the Source.

 

 

eg_esri_gdb01_04.png

 

We navigate to our folder where we have three file databases stored.    ESRI uses an unusual style of naming file geodatabase folders as if they were files, using a three-letter extension.  We double click the WaterDistributionNetwork.gdb folder to enter it.  Note that the files of type box is already loaded with GDB files, since Radian knows from the preceding dialog we want to create a file: gdb data source.

 

eg_esri_gdb01_05.png

 

Mercifully, Radian filters out all of the 160+ files in the folder that are not gdb files and shows us the single file called gdb.   We click on the gdb file and then press Open.

 

eg_esri_gdb01_06.png

 

Taking a moment to review that everything in the New Data Source dialog is as we want, we press Create Data Source.

 

 

eg_esri_gdb01_07.png

 

Radian instantly creates a new data source called Water in the project.

 

 

eg_esri_gdb01_08.png

 

Clicking on the + box to expand the Water data source we see it contains the various drawings and tables for those drawings that are in ESRI's WaterDistributionNetwork.gdb example.

 

Viewing a Drawing

We can work with the GDB as we could with any read/write data source in Radian.

 

eg_esri_gdb01_09.png

 

We scroll down to the wHydrant Drawing and double-click on it to open it.   This drawing shows all of the fire hydrants in Naperville as points.

 

eg_esri_gdb01_10.png

 

Double-clicking the drawing's wHydrant table we see that it provides attributes for each of the hydrants.   Note that the SHAPE field provides the geometry data for each point as a Radian geom.   The Radian dataport for ESRI GDB file geodatabases automatically translates ESRI geometry into Radian geometry to and from.  If we edit this field the changes made within the ESRI file geodatabase will be made in the native ESRI geometry formats.

 

eg_esri_gdb01_11.png

 

To see where all this is located we create an imageserver data source, in this case Google Streets, using the procedure described in the Example: An Imageserver Tutorial topic.   We also create a map and then drag and drop the Google streets layer into that map.

 

 

eg_esri_gdb01_12.png

 

Next, we drag and drop the wHydrant Drawing into the map.   One dot appears in default, gray point format within the US.   Zoomed out to where the entire world is in view one dot is the simplified view.

 

eg_esri_gdb01_13.png

 

To zoom to the wHydrant Drawing data set we right-click on the wHydrant Drawing layer in the map and choose Zoom.  That will zoom the data set to fit.  

 

eg_esri_gdb01_14.png

 

The dots cover up much of the underlying Google streets layer at first but if we zoom further in we can see that yes, indeed, the dots really do show the locations of fire hydrants in Naperville, Illinois.  There's Burlington Park and Naperville North High School not far away.

Using the Data

Absolutely anything we want to do with data in Radian we can do with this linked data source.   Radian's ESRI GDB file geodatabase is fully read/write.   We can work with the drawings and the table as if they were native drawings and tables within the Radian project, or stored within some other Radian project nested into this one as a data source.

 

For example, we can make selections.   Suppose we undock the wHydrant table by Alt-clicking the table tab.

eg_esri_gdb01_15.png

 

We either use the View - Fields dialog or we right-click onto column heads and choose Hide to hide columns to get the above, simpler display.  The LASTSERVICE field gives the date when each fire hydrant was last serviced.    We will select all fire hydrants that were last serviced in the year 2007.

 

To do that we choose Edit - Select to launch the Select dialog.

 

 

eg_esri_gdb01_16.png

 

We choose the Between template, the LASTSERVICE field as the Value and then enter the first and last day of the year in 2007 as the Lower bound and Upper bound.   We use SQL style notation for date values, with the date between # characters.

 

eg_esri_gdb01_17.png

The moment we enter valid dates Radian will preview the result of the Between template using blue preview color in the table.

 

eg_esri_gdb01_18.png

To make that selection in the table we click the Replace Selection button and press Close to close the Select dialog.

 

We have selected all of the records for hydrants last serviced sometime in 2007.

 

 

eg_esri_gdb01_19.png

 

If we like, we can show that selection in the drawing.   We click on the wHydrant Drawing tab in the map to make that drawing the active layer, and then we choose Edit - Select to once more launch the Select dialog.

 

eg_esri_gdb01_20.png

 

In the Select dialog we click on the Window tab to show windows with selections that we can use.  We click on the wHydrant: Water table entry, meaning the table of that name within the Water data source.

 

 

eg_esri_gdb01_21.png

 

As soon as we click the table in the Windows tab in the Select dialog, Radian previews what the selection would look like in the drawing tab using blue preview color.

 

 

eg_esri_gdb01_22.png

 

To make that selection in the drawing tab we click the Replace Selection button.   We press Close to close the Select dialog.    The selected points appear in red selection color.

 

 

 

eg_esri_gdb01_23.png

 

If we like, we can add another imageserver layer, such as a Google satellite layer.  Zooming in, we can see where the various hydrants are located.

 

Notes

Lots of files -  The very large number of files used in a file geodatabase, with essential elements of the data set being stored in separate files that must travel together for the data set to retain coherency, poses obvious risks for fragility.   It is wise when transferring a geodatabase to do like ESRI does, that is, to zip all the files together into a single .zip file.   Given there are very many files involve, all of which must be synchronized, it is also highly unwise to attempt to  modify an ESRI file geodatabase using anything other than ESRI code.   Radian uses ESRI's own SDK to interact with ESRI file geodatabases.  

 

Modern GDB vs Deprecated GDB - The ESRI SDK used by Radian supports connections to ESRI's modern GDB file geodatabase format, in current use for some years.   Many years ago ESRI used an older GDB file geodatabase format that is no longer supported by the ESRI SDK.   Some GDB format data sets are still in circulation on the web that use the old GDB format.   To read those, use Radian's ability to connect through the GDAL library to formats that GDAL supports.  

 

Before GDAL began offering the ESRI SDK as an option to read modern ESRI file geodatabases, a GDAL-written, reverse-engineered module could read some information from the older ESRI GDB file geodatabase formats.   The GDAL module is not perfect in that it is read-only and it cannot extract all data from all file geodatabases, but at least it can extract some, if not all, data in many cases.  Better than nothing! The step by step procedure to use GDAL is given in the Example: Connect to an ESRI GDB using GDAL topic.

 

See Also

Maps

 

Selection

 

Web Servers

 

Select Dialog

 

View - Fields

 

Example: Spectacular Images and Data from Web Servers - A must see topic providing a gallery of views illustrating how Radian can use web servers such as imageservers and other free resources to provide a seemingly endless selection of spectacular background maps, satellite images and GIS data with nearly zero effort.

 

Example: An Imageserver Tutorial - An extensive tutorial showing step by step how to add new data sources that are imageservers, how to show them as layers in a map, how to create a new drawing that matches the projection of the map and how to trace over what is seen in an imageserver layer to create an area object in the drawing.

 

Example: Create an ODBC Data Source with Windows - How to create an ODBC data source (a DSN) using dialogs built into Windows 10.

 

Example: Connect to Manifold from Release 8  - Step by step procedure to connect from Manifold System Release 8 to a Manifold .map file using Manifold's ODBC driver.

 

Example: Connect to an ESRI GDB usng GDAL/OGR  -  Instead of using Manifold's built-in ability to connect to modern ESRI GDB file geodatabases, use the Manifold GDAL/OGR dataport to take advantage of the GDAL library's ability to connect to deprecated GDB formats.

 

Example: Connect Through Manifold ODBC to a Third Party  - With Release 8, use an ODBC connection to a Manifold .map to connect through the .map project to a third party, external data source, an ESRI GDB file geodatabase.  We use Manifold facilities as an intermediary to give Release 8 capabilities it does not have on its own, to link into data stored within an ESRI file geodatabase.

 

Example: Connect LibreOffice Through Manifold to an ESRI GDB - A companion example topic to the Example: Connect Through Manifold ODBC to a Third Party  topic.  Shows how to connect LibreOffice Base, the database part of LIbreOffice, through Manifold to link an ESRI GDB file geodatabase table into LibreOffice.

 

Example: Connect to Manifold from QGIS - Step by step procedure to connect from QGIS 2.8.9 to a Manifold .map file using Manifold's ODBC driver.